Talk About Network

Google





Mac > Perl on OSX > Re: How to run ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 8 Topic 1048 of 1079
Post > Topic >>

Re: How to run Perl script at Mac OS (Darwin) Release?

by igor.sutton@[EMAIL PROTECTED] (Igor Sutton) Mar 9, 2008 at 01:17 PM

On Mar 9, 2008, at 12:31 PM, jeremiah@[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
 




 8 Posts in Topic:
How to run Perl script at Mac OS (Darwin) Release?
garyyang6@[EMAIL PROTECTE  2008-03-07 10:35:04 
Re: How to run Perl script at Mac OS (Darwin) Release?
chas.owens@[EMAIL PROTECT  2008-03-07 13:47:44 
Re: How to run Perl script at Mac OS (Darwin) Release?
jeremiah@[EMAIL PROTECTED  2008-03-08 12:01:22 
Re: How to run Perl script at Mac OS (Darwin) Release?
lprall@[EMAIL PROTECTED]   2008-03-07 13:48:45 
Re: How to run Perl script at Mac OS (Darwin) Release?
jeremiah@[EMAIL PROTECTED  2008-03-09 12:31:17 
Re: How to run Perl script at Mac OS (Darwin) Release?
igor.sutton@[EMAIL PROTEC  2008-03-09 13:17:21 
Re: How to run Perl script at Mac OS (Darwin) Release?
douglist@[EMAIL PROTECTED  2008-03-09 09:12:36 
Re: How to run Perl script at Mac OS (Darwin) Release?
packy@[EMAIL PROTECTED]   2008-03-11 01:37:25 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 13:50:33 PST 2009.