Go Back   CodingForums.com > :: Server side development > Perl/ CGI

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 02-25-2009, 06:20 PM   PM User | #1
Duffman12
Regular Coder

 
Join Date: Oct 2005
Posts: 121
Thanks: 6
Thanked 0 Times in 0 Posts
Duffman12 is an unknown quantity at this point
shebang and perl install directory in windows

So the shebang is there to find the location of the perl interpreter. I found this info:
Quote:
For the perl path C:/usr/bin/perl.exe all of these are/were valid. I prefer the last one because of the Linux <<>> Windows portability.
#!C:/usr/bin/perl.exe
#!C:/usr/bin/perl
#!/usr/bin/perl.exe
#!/usr/bin/perl
this guy suggets you install perl in C:/usr instead of the default c:/perl. This seems logical because unix machines use usr/bin/perl. (the reason this issue arose in the first place was because I installed bugzilla, and they're using usr/bin/perl)

So the consensus is that I want the shebang to be #!usr/bin/perl.

One solution is to reinstall perl in C:/usr. Are there any draw backs to this?

Is there another way to get these results? manipulate the PATH or httpd.conf or something to alias usr/bin to C:/perl/bin?
Duffman12 is offline   Reply With Quote
Old 02-25-2009, 06:29 PM   PM User | #2
KevinADC
Senior Coder

 
Join Date: Mar 2006
Posts: 1,274
Thanks: 2
Thanked 39 Times in 38 Posts
KevinADC is on a distinguished road
You can try it but you will need to completely uninstall perl if its already installed, reinstall it to the new directory and see how it works. But if the only reason is to avoid having to change the shebang line that is trivial. Changing a shebang line takes like 2 seconds.
KevinADC is offline   Reply With Quote
Old 02-26-2009, 12:04 AM   PM User | #3
FishMonger
Moderator


 
Join Date: May 2005
Location: Southern tip of Silicon Valley
Posts: 2,530
Thanks: 2
Thanked 96 Times in 92 Posts
FishMonger will become famous soon enough
Windows doesn't use the shebang line to find the location of the perl interpreter. It uses the file type association, default being .pl but you can easily create an additional one for .cgi.

If you're using the apache web server, it can/will use the shebang line. However, when running apache on Windows, you can use the ScriptInterpreterSource directive to tell it to use the registry to find the location of the perl interpreter.

Code:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
    ScriptInterpreterSource Registry
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
FishMonger is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:28 AM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.