in reply to bad interpreter: Permission denied

Chances are there is a ^M at the end of the shebang line. Try converting the whole file to unix line ends.

Update: There are lots of ways. You can use system tr, ftp in ASC mode, zip/unzip for a bulk conversion, and any number of specialized unstandardized converters (not to mention awk and sed). Since you're learning perl, I suggest:

$ perl -pi.bak -e 's/\015//' *.pl
once you have checked perlrun to see what the flags do.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: bad interpreter: Permission denied
by sfink (Deacon) on Apr 10, 2002 at 23:25 UTC
    I'm lazy, so when this happens to me I just add a -w to the shebang line:

    #!/usr/bin/perl -w

    The -w option seems perfectly happy to have a ^M after it. It's not really safe, but for the most part carriage returns won't make any difference at the ends of lines; they're just whitespace to perl anyway.

    Of course, it could make the bugs even more mysterious...

Re: Re: : bad interpreter: Permission deniedrl
by Guildencrantz (Sexton) on Apr 10, 2002 at 01:32 UTC
    Ah, this does look like the problem. I typed a script in my Linux emacs install and it works fine. How do I just convert a file to Unix line ends though? I don't really want to retype all my scripts. ~~Guildencrantz
      use a program called dos2unix (in Redhat and available for most *nix's).

      "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!
        Ah, perfect. Thank you for your help ~~Guildencrantz