[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] MacPerl CGI and WebTen



I'm testing WebTen here with the intent of stopping using Webstar and
switching to WebTen.  So one of the things I'm doing is testing all my
Perl CGIs scripts.

And I've noticed this odd phenomenon when running MacPerl CGIs (saved as
CGI scripts, not plaintext files) under WebTen.
When I run the following code as a CGI:

print "Content-type: text/html\n\n
<HTML LANG='en-US'><HEAD><TITLE>Test</TITLE>
<BODY BGCOLOR='#c0c0c0' TEXT='#000000' LINK='#0000FF' VLINK='#52188c'
ALINK='#FF0000'>
<PRE>";
foreach (qw(
    SCRIPT_NAME 
)) { printf("%-20s:%s\n", $_, $ENV{$_} ) }
print "Perl version: $]\nOS name: $^O\nMyself: $0</PRE>\n",
  scalar(localtime),
  "</BODY>\n</HTML>\n";

I get:

SCRIPT_NAME         ://sean/test.pl
Perl version: 5.004
OS name: MacOS
Myself: 7200HD:WebSTAR:Sean:test.pl

Notice the double-slash on SCRIPT_NAME.
Under Webstar I get the expected:
SCRIPT_NAME         :/sean/test.cgi
Perl version: 5.004
OS name: MacOS
Myself: 7200HD:WebSTAR:Sean:test.cgi


Of course, under WebTen it'd generally be a good idea to use the Perl
interpreter in WebTen's UNIXish filesystem instead of using MacPerl
(unless you needed MacPerl-specific functions, of course), but I have a
couple dozen legacy scripts where I use SCRIPT_NAME.
A fix on my end is to run a search for all such scripts (using a grep I
wrote which searches the resource fork -- which I should post, by the
way) with SCRIPT_NAME in them, and apply a s<^//></>s someplace.

So:
1) Has anyone else run into this?
2) Does anyone know if it's a MacPerl problem or a WebTen problem or
what?

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch