> -----Original Message-----
> From: Mahdi A Sbeih [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 12, 2006 2:41 AM
> To: beginners@perl.org
> Subject: calling a perl script on windows
> 
> Hi all,
> 
> I am working on porting some scripts from unix to windows, and I noticed
> that perl ignores the first line of the script, and it seems I have to
> run the script like this:
> D:\Perl\bin\perl.exe myscript.pl
> 
> if I run it like we do on unix:
> ./myscript.pl
> 
> it will search the path and it uses the perl found in the path env
> variable.
> 
> 
> How can I make it to run exactly like Unix, meaning, just use the first
> line in the script?
> 
> Thanks,
> Mahdi.
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>


For windows make sure you have the path to the perl executable in the path
(environment variable)
For example, if you perl.exe executable resides in c:\perl\bin
Make sure you put c:\perl\bin in the PATH
Also, make sure you associate the .pl extension with the perl.exe
executable.  You can do this within Windows Explorer\Tools\Folder
Options\File Types

Doing that will enable you to run any perl script from the command line
without calling perl first....ie. you can just type foo.pl and it will run.
And likewise if you clicked on the file within windows.....it will
automatically run the perl interpreter to run the script.

Hope that helps.

Regards,
Sam


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to