Re: How to run Perl script at Mac OS (Darwin) Release?
[email protected] (Igor Sutton)
| Newsgroups | perl.macosx |
|---|---|
| Message-ID | <[email protected]> |
On Mar 9, 2008, at 12:31 PM, [email protected] wrote: > > On Mar 7, 2008, at 7:48 PM, Larry Prall wrote: > >> Change the she-bang (#!) line to read: >> >> #!/usr/bin/perl -w >> >> That's the location of the default perl installation on OS X. > > That _may_ be the problem, but it is not necessarily the problem. I > believe that if there was no perl interpreter in the path that the > OP specified, bash would say - > > "bash: ./test1i.pl: #!/usr/local/ActivePerl-5.10/bin/perl: bad > interpreter: No such file or directory" > > But instead bash is saying "Command not found." So the OP may in > fact have a perl interpreter in the path specified on the command > line, but he is not calling the script correctly. So advising the > OP to change the shebang may be premature. > > The script was not called correctly from the command line, of that > we can be certain. I think he's missing the execution bit (where someone already spotted) and since bash on MacOS X doesn't have the current directory in PATH, one must execute the program like: $ ./test1.pl Instead of $ test1.pl In the same directory, or change the PATH to use the current working directory $ PATH=$PATH:. test1.pl Hope this helps