Hi -

> -----Original Message-----
> From: Rob Richardson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 8:23 AM
> To: [EMAIL PROTECTED]
> Subject: Script that runs on my Win98 box and the Unix server
>
>
> Greetings!
>
> I have been using my Win98 box to modify some scripts that will be run
> on a Unix server.  Within the body of the script, I can surround
> OS-specific things like test code I want my machine to execute and
> calls that throw errors under Win98 like flock() with checks to see
> what operating system I am using.
>
> But is there a way to differentiate between the two operating systems
> on the first line?
>
> On my box, it's "#!perl".  On the Unix box, it's "#!usr/bin/perl".
> What I'll probably end up doing is uninstalling Perl from my box and
> reinstalling it in a folder named usr/bin, but I'd rather not do that.
> Is there any way I can have two different paths to the Perl executable,
> and let my script decide which to use?
>
> On the face of it, this looks like a ridiculous question.  How can the
> Perl executable decide where the Perl executable is before Perl starts
> executing?  But maybe there's some trick with the registry or
> environmental variables or something that will help.
>
> RobR
>

I am really confused by your statement that on Win98 the first script
line is used AT ALL. On the windows platforms I have used to
run perl script (Win95, (maybe 98), ME, NT, 2000, XP) the system
has no concept of reading the script to determine what executable
to use. Are you using a special shell (cygwin, msys, etc.) or
running from the standard cmd.com? The standard windows cmd.com
will attempt to execute _any_ file with the extensions .exe,
.bat, and maybe still .com. It has no concept of the 'executable'
permission bit becuase the is no such thing in the Windows/DOS file
attributes.

The standard windows shell uses a file association table so that
an extension, say .pl, can be associated with perl.exe.

Please help me understand the behaviour you describe.

Aloha => Beau;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to