| Store | Cart

Re: Questions on porting Perl from Unix to Windows

From: Jenda Krynicky <Jen...@Krynicky.cz>
Fri, 25 Jan 2008 01:37:39 +0100
From:           	Frank Merrow <fmer...@qualcomm.com>
> >Second question:> >The UNIX #!/usr/bin/perl notation does not work with Perl scripts on > >Windows. How should I code if it is Unix I place "#!/usr/bin/perl" > >at the very first line of the script? But, I do not place it at the > >first line of code if it is not Unix? How should I do it?> > This question is more complicated.  I don't have time to research a > full answer.  Plus because of some windows nonsense, some user can > run commands like this:> >  >somescript.pl> > and some cannot . . . so . . . we wrap all our perl utilities as BAT files.

See the PATHEXT system variable. And make sure the file type mapping 
is 
   "D:\Perl\bin\perl.exe" "%1" %*
not just 
   "D:\Perl\bin\perl.exe" "%1"

> I offer this *.BAT stub as an answer we have come up with (not the > only or best - just "a" solution):> > @rem = '--*-Perl-*--> ...

ActiveState (before ActiveWare, before Hip Communications) contained 
a pl2bat command for as  long as I remember that does something like 
this.

HTH, Jenda
===== Jen...@Krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
	-- Terry Pratchett in Sourcery

Recent Messages in this Thread
Jenda Krynicky Jan 25, 2008 12:37 am