----- Original Message -----
From: "Andreas-Schmitz" <[EMAIL PROTECTED]>
To: "Michael A. Chase" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 16:10
Subject: Re: Installing dbi on windows 98


> > The MSDOS shell ignores the #! line and Perl doesn't worry about the
part
> > before 'perl', so it's better to leave it as "#!/usr/bin/perl ..." in
case
> > you decide later to move to a system with a real shell.  The "-wT" is a
good
> > idea.
> Your right! Do not code the perlscript in your DOS-Shell. Put it into
> your cgi-bin directory and run it from html, right?
>
> --
> #!C:\perl\bin\perl.exe -wT

I don't know why so many have so much trouble with this.  I am not talking
about the physical location of the Perl script.  I am talking about the
content of the first line of the Perl script file.

1.  The "shell" that comes with MSDOS derivatives (including all versions of
Windows) _DO_NOT_ understand the #! line so putting a MSDOS path there has
no effect.

2.  Most UNIX shells do recognize the #! line and will call whatever program
is given there to interpret the file.  This works the same whether you are
using Perl, Bourne Shell, C Shell, Bash, env, or some other program known
only to you.

3.  The perl interpreter will parse the #! line starting after the word
'perl' for switches so switch parsing by the perl interpreter will be
consistent across platforms.

So it follows that putting "c:\perl\bin\perl.exe" in the #! line provides no
advantage in MSDOS derived systems and will interfere with running the
script in UNIX systems.  Any script that might be run in both environments
should use the UNIX location (usually "/usr/bin/perl") on the #! line.

I have many scripts that run _completely_unchanged_ in Win95, Win98, WinMe,
WinNT, Win2000, Dynix, HPUX, Solaris, an Linux.  They all have
"#!/usr/bin/perl -w" as the first line.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


Reply via email to