in reply to running scripts in Mac OS 10.4

You didn't by chance upload from a Windows box using FTP did you? If you uploaded in binary mode, it will mangle the line endings and the #! line won't make sense to the shell. If you invoke perl manually, perl is smart enough to handle both unixy and windowsy line endings.

If you did upload with FTP, try uploading again in ASCII mode.

--Pileofrogs

Replies are listed 'Best First'.
Re^2: running scripts in Mac OS 10.4
by Corion (Patriarch) on Jun 25, 2008 at 16:44 UTC

    This is another argument why -w is far superior than use warnings;.

    #!/usr/bin/perl -w

    will work in situations where

    #!/usr/bin/perl use warnings;

    will not :)

Re^2: running scripts in Mac OS 10.4
by CountZero (Bishop) on Jun 25, 2008 at 18:23 UTC
    I think you meant well, but you said it wrong.

    FTP in binary mode does not mangle your line-endings. This mode does not even have a concept of what line endings are. It will keep everything "as is" and if the line-endings happen to be wrong for your kind of OS, they will simply remain wrong.

    On the other hand, ASCII mode will try to "translate" the wrong line endings to what your box expects (actually the sender translates the data into a common 8-bit ASCII format with line endings being <CRLF> or <NL> and the receiver will translate this data in its internal format - read all about it here). Whether that is a good thing is something what remains to be seen.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re^2: running scripts in Mac OS 10.4
by rogerd (Sexton) on Jun 25, 2008 at 19:53 UTC
    No, I wrote the scripts myself. I use the TextWrangler editor, for Mac, which is the light version of the BBEdit editor. That's why I haven't thought it was a problem of line endings; however I am checking that with the way the other sugest me...