RE: No output (Newbie question)

2002-12-16 Thread Deshazer, Earl (GEAE)
Well,
I have had that problem several times and I figured out there could be
one of two problems.
1) Hidden Mac endings in your script (\r) when it should be unix (\n)
2) Executing in Mac is ./script_name

With regards to the first problem, if you edit the file in vi or emacs, then you
should be okay. If you edit the file in BBedit, then you have to go and choose
one of the options that saves with Unix endings. I don't know what you do in
other editors.

With regard to command execution. Unlike the flavors of Unix that I am familiar
with, Unix requires a specification on where the command is thus ./

Good Luck,
Will DeShazer

-Original Message-
From: San Tunstall [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 15, 2002 10:48 PM
To: [EMAIL PROTECTED]
Subject: No output (Newbie question)


Hi folks,

I've searched the archives but can't find an answer to this question.

I've run perl scripts from DOS and cygwin but cannot get a basic hello 
world script to work on my Mac.

#! line, permissions on the script, location of perl, etc. seem to be 
ok. But when I try to run a script I get no result. No error message, 
no hello world printed to the terminal. Tried redirecting output to a 
file, but file was empty.

When I try to run perl interactively, it starts up as a process, but I 
get no error messages when I type nonsense and no output to the 
terminal when I enter simple print commands.

Versions:
perl, v5.6.0
osx 10.2

Any idea how to troubleshoot this?

Much obliged
San



Re: No output (Newbie question)

2002-12-16 Thread Peter N Lewis
#! line, permissions on the script, location of perl, etc. seem to 
be ok. But when I try to run a script I get no result. No error 
message, no hello world printed to the terminal. Tried redirecting 
output to a file, but file was empty.

Check the line endings on the file, this is a classic symptom of 
having the wrong line endings such that the entire file looks like a 
single line, all commented out by the leading #
   Peter.
--
http://www.interarchy.com/  http://download.interarchy.com/


RE: No output (Newbie question)

2002-12-16 Thread San Tunstall
You are right. That was exactly the problem. Needed to tell BBedit waht
kind of end-of-line to use. Thanks!

On Mon, 16 Dec 2002 09:02:08 -0500, Deshazer, Earl (GEAE)
[EMAIL PROTECTED] said:
   I have had that problem several times and I figured out there could be
 one of two problems.
 1) Hidden Mac endings in your script (\r) when it should be unix (\n)
 ...
 With regards to the first problem, if you edit the file in vi or emacs,
 then you
 should be okay. If you edit the file in BBedit, then you have to go and
 choose one of the options that saves with Unix endings.




Re: No output (Newbie question)

2002-12-16 Thread Rich Michaela


Deshazer, Earl (GEAE) wrote:



 With regard to command execution. Unlike the flavors of Unix that I am familiar
 with, Unix requires a specification on where the command is thus ./

This has nothing to do with what flavor of UNIX you're running. and everything to
do with your PATH environment variable. Where is the script located? If it's in
your path it will execute by calling by name. If not you'll nned to qualify the
path to the file, or (as in this example) if you're in the same directory, prepend
the ./filename. OS X's somewhat un-UNIX-like Directory names, means care must be
taken when defining your PATH variable. If you're on a multi-user machine, avoid
the temptation of adding a . to your PATH. One standard appraoch is to define a
bin directory under your $HOME, then adding $HOME/bin or ~/bin to the end of you
PATH.