Hi,
I'm trying to get my Perl script to run under Apache/CGI on Windows.
With latin-based pathnames the shebang notation works fine under all Apache versions for determining the perl executable location, e.g.:
#!C:/Program Files/SpatialDirect/Perl/bin/perl.exe
If I then introduce Japanese character data into the path I can only get the script to successfully run under Apache 1.3.33 (no Apache2 variants work). e.g.:
#!C:/Temp/情報/Perl/bin/perl.exe
This is almost acceptable but where things fall down is if the Japanese (Shift_JIS) characters contain the hex 5C byte sequence (\ in ascii). e.g.:
#!C:/Program Files/表示設定/Perl/bin/perl.exe
Under this scenario Apache still seems happy but Perl now complains with the following errors:
Premature end of script headers: c:/program files/apache group/apache2
+/cgi-bin/spatialdirect/spatialdirect.pl
Can't locate strict.pm in @INC (@INC contains: .) at c:\\PROGRA~1\\APA
+CHE~1\\apache2\\cgi-bin\\SPATIA~1\\SPATIA~1.PL line 40.\n
BEGIN failed--compilation aborted at c:\\PROGRA~1\\APACHE~1\\apache2\\
+cgi-bin\\SPATIA~1\\SPATIA~1.PL line 40.\n
Where line 40 (referenced in the error above) is the first non-comment line in the code and contains simply:
use strict;
Commenting out this line gives the same error on the next line which is:
use LWP::UserAgent;
ie. Perl is having a lot of trouble with the un-escaped \ in the path.
Does anyone know how I can get around this?
thanks,
Nic
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.