in reply to Re: Stuff and Things
in thread Stuff and Things

Fixed. Changed my to local. Forgot that my couldn't be used for that... (how absent-minded of me!) As for the ! after the #... it seems to work fine with that left in, as long as you don't try to run it directly (under Unix at least), but rather either run it under Win32 or use the Perl interpreter explicitly (perl poem.pl).

Drake Wilson

Replies are listed 'Best First'.
Re: Re: Re: Stuff and Things
by chipmunk (Parson) on Feb 27, 2001 at 10:00 UTC
    Nope, having a fake #! line will cause a fatal error, even if you invoke perl explicitly: perl poem.pl because Perl detects the #! line and tries to exec the specified command, just like a shell would do: Can't exec Ambiguity! at poem.pl line 1. This is documented in perlrun:
    If the #! line does not contain the word "perl", the program named after the #! is executed instead of the Perl interpreter. This is slightly bizarre, but it helps people on machines that don't do #!, because they can tell a program that their SHELL is /usr/bin/perl, and Perl will then dispatch the program to the correct interpreter for them.
      Hmm... doesn't seem to work that way for me... must have a non-standard interpreter or something. In any case, thanks, and fixed.