shebang question for Win32 Perl/Apache 
Author Message
 shebang question for Win32 Perl/Apache

I recently installed Apache 1.3.9 on my Win95 box to put the OS
to good use ;^) and I've been hunting down solutions to a problem
with the shebang line that starts all my Perl scripts so that I can
continue to write #!/usr/bin/perl (which is where Perl is on
the Linux production box), rather than #!c:\perl\bin\perl .

The closest I've been able to come is to create a directory
at c:\usr\bin to house a copy of perl.exe, and use
#!c:/usr/bin/perl locally (because it at least works with forward
slashes).

Has anyone been able to do this so that they can omit the
"c:" entirely?  Or am I SOL and going to have to always remember
to modify this when I upload to production?

Unfortunately, not using the Win95 OS is not an option right
now.

Thanks in advance,

Dan

--
Daniel Kirkdorffer
Email: webmaster 'at' disciplineglobalmobile 'dot' com



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache

Quote:
> The closest I've been able to come is to create a directory
> at c:\usr\bin to house a copy of perl.exe, and use
> #!c:/usr/bin/perl locally (because it at least works with forward
> slashes).

> Has anyone been able to do this so that they can omit the
> "c:" entirely?  Or am I SOL and going to have to always remember
> to modify this when I upload to production?

How about executing your Perl program on the windows side using "perl
mypogram"?

Brandon



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache

Quote:
> and I've been hunting down solutions to a problem
> with the shebang line that starts all my Perl scripts so that I can
> continue to write #!/usr/bin/perl (which is where Perl is on
> the Linux production box), rather than #!c:\perl\bin\perl .

Much better luck asking this question in a group that deals with Apache.

Read the Apache docs.  1.3.6 Apache allowed the option to use a registry
setting to run instead of the #! line.

http://www.apache.org/docs/mod/core.html#scriptinterpretersource

--

pls note the one line sig, not counting this one.



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache


says...

Quote:
> I recently installed Apache 1.3.9 on my Win95 box to put the OS
> to good use ;^) and I've been hunting down solutions to a problem
> with the shebang line that starts all my Perl scripts so that I can
> continue to write #!/usr/bin/perl (which is where Perl is on
> the Linux production box), rather than #!c:\perl\bin\perl .

> The closest I've been able to come is to create a directory
> at c:\usr\bin to house a copy of perl.exe, and use
> #!c:/usr/bin/perl locally (because it at least works with forward
> slashes).

> Has anyone been able to do this so that they can omit the
> "c:" entirely?  Or am I SOL and going to have to always remember
> to modify this when I upload to production?

Try omitting the 'c:'.  If Apache is installed on drive C: and/or the
web cgi-bin directory is on drive C:, there is no reason to assume the
current drive would be anything but drive C:.

--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache

Quote:

> Try omitting the 'c:'.  If Apache is installed on drive C: and/or the
> web cgi-bin directory is on drive C:, there is no reason to assume the
> current drive would be anything but drive C:.

Got it.  My problem was all the examples I saw were on C: and of course
I've installed Apache on E:.  #!\usr\bin\perl works fine now that
I've made a usr\bin\ directory on E: with perl.exe in it.

Thanks,

Dan



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache


says...

Quote:
> Got it.  My problem was all the examples I saw were on C: and of course
> I've installed Apache on E:.  #!\usr\bin\perl works fine now that
> I've made a usr\bin\ directory on E: with perl.exe in it.

I assume you mean #!/usr/bin/perl, because your Unix systems won't be
happy with backslashes.

--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache
:I recently installed Apache 1.3.9 on my Win95 box to put the OS
:to good use ;^) and I've been hunting down solutions to a problem
:with the shebang line that starts all my Perl scripts so that I can
:continue to write #!/usr/bin/perl (which is where Perl is on
:the Linux production box), rather than #!c:\perl\bin\perl .
:The closest I've been able to come is to create a directory
:at c:\usr\bin to house a copy of perl.exe, and use
:#!c:/usr/bin/perl locally (because it at least works with forward
:slashes).
:Has anyone been able to do this so that they can omit the
:"c:" entirely?  Or am I SOL and going to have to always remember
:to modify this when I upload to production?

If perl and your Apache server are installed on the same drive you can
omit the c:, other wise it has to be there.  Since your Linux box uses
#!/usr/bin/perl I would strongly suggest re-installing Perl onto the
same drive as Apache in a directory named (using c: as an example)
c:\usr\bin.  As you note, neither Perl nor Apache care about the
direction of your slashes so you can then just use #!/usr/bin/perl at
the top of your scripts and they will work fine on both machines.  I
have never tried placing perl.exe in a directory by itself but I fear
that you will have problems with such an arrangement.

HTH

--

--random quote --
Imagination is more important than knowledge.
 - Albert Einstein



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache
Yes.

Quote:



> says...
> > Got it.  My problem was all the examples I saw were on C: and of course
> > I've installed Apache on E:.  #!\usr\bin\perl works fine now that
> > I've made a usr\bin\ directory on E: with perl.exe in it.

> I assume you mean #!/usr/bin/perl, because your Unix systems won't be
> happy with backslashes.

> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/


--
Daniel Kirkdorffer
Sr. Consultant, Syllogistics, LLC.
Email: dan.kirkdorffer 'at' syllogistics 'dot' com
       daniel.kirkdorffer 'at' attws 'dot' com
Web:   http://www.syllogistics.com/
       http://members.aol.com/dankirkd/
Visual Cafe Tips:
       http://members.aol.com/dankirkd/vcafe.htm


Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache

Quote:


> says...
>> Got it.  My problem was all the examples I saw were on C: and of course
>> I've installed Apache on E:.  #!\usr\bin\perl works fine now that
>> I've made a usr\bin\ directory on E: with perl.exe in it.

> I assume you mean #!/usr/bin/perl, because your Unix systems won't be
> happy with backslashes.

I would also suggest that he properly install Perl into that directory -
I.E specify E:\usr as the target directory when asked otherwise its highly
likely that there will be surprises ...

/J\
--

Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache

Quote:

> As you note, neither Perl nor Apache care about the
> direction of your slashes...

FYI, DOS didn't care either, I used it extensively.
It wouldn't suprise me if that 'not caring' was not
even a special case but simply worked because Windows
understands it.

Martijn van Oosterhout
Australia



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache



: >
: > As you note, neither Perl nor Apache care about the
: > direction of your slashes...
: FYI, DOS didn't care either, I used it extensively.
: It wouldn't suprise me if that 'not caring' was not
: even a special case but simply worked because Windows
: understands it.

In a general sense that is true but in the specific it may lead to
unexpected results.  While there are many cases in which DOS doesn't care
there are many where it does matter.  A couple of simple examples: from the
root directory of C what does:
cd c:/windows do under your version of dos?
How about cd "C:/windows" as opposed to cd "C:\windows" ?

To my way of thinking, it might be a bit generous to say that DOS doesn't
care about the path separator.  DOS tends to be a bit fickle.

AmD
[posted and a similar version emailed (didn't catch the stealth cc at first)

--

--Random Quote--
Skill in manipulating numbers is a talent, not evidence of divine guidance.
  Ashley-Perry Statistical Axioms[2]



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache




: : FYI, DOS didn't care either,
[snip]
: In a general sense that is true but in the specific it may lead to
: unexpected results.  While there are many cases in which DOS doesn't care
: there are many where it does matter.  A couple of simple examples: from
the
: root directory of C what does:
: cd c:/windows do under your version of dos?
: How about cd "C:/windows" as opposed to cd "C:\windows" ?

Ok, I decided that was a bad example as it is more about feeding parameters
to a DOS command than DOS itself.  To use an example from this thread, at
the prompt:

c:\usr\local\bin\perl

starts up perl just fine but

c:/usr/local/bin/perl
does not.

AmD
--

--Random Quote--
I dunno, I dream in Perl sometimes...



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache

Quote:

>To my way of thinking, it might be a bit generous to say that DOS doesn't
>care about the path separator.  DOS tends to be a bit fickle.

We're talking about the shebang ("#!") line. DOS doesn't know about
shebang lines.

(DOS) programs that do know about it, will also accept "/" as directory
separators. That definitely includes Perl. I have no experience with
Apache to know if the exact path (apart from the "perl" part) even
matters; but if it matters, forward slahes very likely will work.

--
        Bart.



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache

Quote:

> c:\usr\local\bin\perl

> starts up perl just fine but

> c:/usr/local/bin/perl
> does not.

Yes but this is because the stupid command interpreter uses the / as its
switch character - this is a behaviour of the command interpreter and
not DOS itself which does the have the ability to use either path
separator - I've posted about this before so I wont go on ...

/J\
--

Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>



Wed, 18 Jun 1902 08:00:00 GMT  
 shebang question for Win32 Perl/Apache
if you associate .pl files with you're perl.exe then you can simply invoke them by name

Quote:
> windoze.pl

all the interpreter cares is that the string perl is somewhere on the the first line


Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. Disable Apache shebang line "feature"?

2. Cross-platform shebang line CGI script shenanigans - Windows and Linux with Apache

3. Shebang line question

4. Perl and Apache question. (A newbie question)

5. Perl Test Problem - show-shebang

6. Shebang line -- What exactly does Perl do?

7. Buffering with Perl/Apache on Win32

8. text/plain Perl files in cgi-bin on Apache (Win32)

9. Cannot run Perl CGI script with Apache Win32

10. Win32 + Apache, how to install Perl?

11. Mail::Sender bad file descriptor (Apache for Win32 on win2k, ActiveState Perl 5.6, Win2k SMTP server)

12. Perl - Apache Win32

 

 
Powered by phpBB® Forum Software