> Hi all, Hello Mahdi.
> 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? You can't, essentially. Unlike Unix shells, Windows doesn't open and read the file to decide what to do with it, and the only way to identify it as a Perl file is to add the .pl filename extension. Perl will, however, honour the switches in the #! line to control how it runs the program, so #!perl -w will enable warnings, for instance. If you want to chnage the instance of Perl used to run your program, then you must either mention it explicitly on the command line or change the file associations for .pl files. You might also want to take a look at 'pl2bat' which will create a myscript.bat for you so you can say just 'myscript' on the command line. The resulting batch file can be edited to select a specific perl.exe rather than the first one in the path. HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>