Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Using Perl, some Windows version and #!usr/bin/perl, WHY?

by strat (Canon)
on Mar 21, 2004 at 12:14 UTC ( [id://338435]=note: print w/replies, xml ) Need Help??


in reply to Re: Using Perl, some Windows version and #!usr/bin/perl, WHY?
in thread Using Perl, some Windows version and #!usr/bin/perl, WHY?

Quote: TStanley

If I remember correctly, both Windows and Unix look on the shebang line for any switches passed in(i.e. the -w or -i switches)

Not exactly; under Unix the shell cares for the shebang, but the Windows shells (cmd.exe, command.com) don't know anything about shebangs (only cygwin knows, off course). Perl itself cares for the parameters like -w, -n, -i, -p, ....


Quote: wolfi

~ servers (even those on localhost windows) may require it. (My apache gets upset when i omit my #!C:\perl\bin\perl.exe line.)

For Apache 1.3, there exists an option in httpd.conf which is called ScriptInterpreterSource registry. If you activate this line, Apache looks for the file extention when executed as CGI (e.g. cgi), looks up in the registry what to do with a files with the extention .cgi ... well, execute it with perl... and does it. Then you can use whatever shebang you like. I like to use this when I'm developing webpages under Windows where the production server is Linux/Unix. Another benefit is that you can test more perl-versions by just assigning another perl-interpreter to .cgi or .pl and need not changing ton's of files...

Btw: You can associate an ending with an interpreter under windows in the shell the following way:

assoc .pl=Perl assoc .cgi=Perl ftype Perl="D:\Programs\gnu\perl809\bin\perl.exe" "%1" %*
(Dont forget the " in ftype, or you will get funny results if there are spaces within the paths...)

For Apache2 there exists a similar command, but I don't know it by heart

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Replies are listed 'Best First'.
Re: Re: Re: Using Perl, some Windows version and #!usr/bin/perl, WHY?
by wolfi (Scribe) on Mar 21, 2004 at 13:02 UTC

    well, ya learn something new every day ;-)

    thank you for the info strat. I've done a decent amount of editting of the httpd.conf but never come across using that ScriptInterpreterSource argument.

    will have to pay more attention to that in the future. Thanks again ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://338435]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-24 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found