Odd Perl interpreter problem

Scott Lanning slanning at BUPHY.bu.edu
Sat Dec 29 20:37:40 EST 2001


On Sat, 29 Dec 2001, Ron Peterson wrote:
>On Sat, 29 Dec 2001, Lars Kellogg-Stedman wrote:
>> > I have #!/usr/bin/perl as interpreter line in scripts.
>> > I get "bad interpreter: no such file or directory" messages when trying to
>> > run the script.
>>
>> Make sure there aren't any extra spaces after the #! line.
>> '#!/usr/bin/perl ' is not the same as '#!/usr/bin/perl'.
>
>Similar problem can happen if you edit a perl script on a samba share
>using notepad.  You'll end up with carriage-return linefeed, rather than
>just a newline.

I do `od -c script.pl` to see exactly the file contents.
Sometimes there could be a ^M before the shebang line or
some other "invisible" characters.
Also make sure you spelled /usr/bin/perl correctly. :)




More information about the Discuss mailing list