in reply to problem with shebang

Nobody has mentioned the other major cause of this symptom, dos line endings. If I do a unix2dos conversion on one of my scripts, it will have the same symptoms as you describe......
1. will not run from shebang 2. will run with "perl myscript" 3. will look fine with "cat myscript".
Try running dos2unix on your script. Or look for control-M characters as line endings in your editor. MC's mcedit shows them.

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: problem with shebang
by ikegami (Patriarch) on Apr 15, 2006 at 17:35 UTC
    Actually, because of the -W, it would work with CRs:
    $ od -c 543561.pl 0000000 # ! / u s r / b i n / p e r l 0000020 - W \r \n \r \n p r i n t " H e l 0000040 l o , W o r l d ! \ n " ; \r \n 0000060 $ 543561.pl Hello, World!