puzzle of split() running under mod_perl

2003-06-17 Thread JY - June Young
Title: Message




Hi,

We arerunning 
CSWS1.2(based on Apache 1.3.6) on Open VMS V7.3-1 and 
CSWS_PERL V1.1 based on Mod_Perl V1.25.

We have a function that changes the 
directory format from Unix to VMS, and this function is used in almost every 
script of our CGIs. Whenever the CGI that invokes this function get requested 
twice, the server process dies after the page comes out.
In a single threaded server, we get Fatel 
error in the error log file.
 Fatal VMS error (status=36) at 
ROOT$:[PERL5_006_01]VMS.C;2, line 802 during global destruction.
In a multi threaded server, we get a notice 
in the error log file
 [notice] child pid ab26 exit 
signal Bad system call.


We noticed that it is the regex argument of 
function split causes the problem. 
We took this 
split statement out into a simpleCGI script, and that CGI script works 
fine in mod_perl.

Afteradding quotes outside of the 
regex of split function in 
subVMSify, the error went away.We could not figure out why the statement bombs out in our VMSify 
functionand why adding quotes fixed 
it. The following are the test script and output in the browser. 


Thanks in advance for all 
helps.

test.cgi
***
use strict;print "content-type:text/html\n\n";print 
"head/headbody\n";

Test();

sub Test{ foreach (@::INC) 
{ VMSify($_); }}

sub VMSify{ my @subDirs; my 
$directory=uc(shift);

 $directory=~s/^\/|\/$//g; 
print "dir=$directory\nbr";# 
@subDirs=split("/\//",$directory); 
@subDirs=split(/\//,$directory); 
$directory=undef; if(defined 
$ENV{$subDirs[0]}){ 
$directory=shift(@subDirs).':'; }elsif(scalar(@subDirs)==1 
 $subDirs[0] eq '.'){ # Special case 
for current directory 
@subDirs=(); $directory='[]'; 
} if(scalar(@subDirs)){ 
$directory.='['; 
$directory.=join('.',@subDirs);
 $directory.=']'; 
} print "dir after=$directory\nbr"; 
return $directory;}

***
The output in the web brower is
dir=DYM$DISK/DYMAX/PERL/DYLIB dir 
after=DYM$DISK:[DYMAX.PERL.DYLIB] dir=PERL_ROOT/LIB/VMS_AXP/5_6_1 dir 
after=PERL_ROOT:[LIB.VMS_AXP.5_6_1] dir=PERL_ROOT/LIB dir 
after=PERL_ROOT:[LIB] dir=PERL_ROOT:[LIB.SITE_PERL.VMS_AXP] dir 
after=[PERL_ROOT:[LIB.SITE_PERL.VMS_AXP]] dir=PERL_ROOT:[LIB.SITE_PERL] 
dir after=[PERL_ROOT:[LIB.SITE_PERL]] dir=PERL_ROOT/LIB/SITE_PERL 
dir after=PERL_ROOT:[LIB.SITE_PERL] dir=. dir after=[] 
dir=APACHE$ROOT dir after=APACHE$ROOT: dir=APACHE$ROOT/LIB/PERL 
dir after=APACHE$ROOT:[LIB.PERL] 

June Young, Software 
Development 
bus: (902)422-1973 x144Dymaxion Research Ltd., 5515 Cogswell 
St., fax: (902)421-1267Halifax, Nova Scotia, 
B3J 1R2 
Canadamailto: 
[EMAIL PROTECTED]http://www.dymaxion.ca




perlwarn break our CGIs

2003-06-10 Thread JY - June Young
Title: Message





Hi, all,

We are at a stage of 
converting CGI to run under mod_perl.
In order to help 
debugging our CGI code under mod_perl, we turned PerlWarn On.
Unfortunately, after 
turning on PerlWarn, our CGIs that already run well under mod_perl get broken 
with the message 
"page 
cannot be displayed" on browser. The error.log does not show the corresponding error for the 
request, but list tons of warnings such as "Use of uninitialized value in split 
at /perl_root/lib/Cwd.pm line 103 during global destruction".
Didanyone encounter the similar 
symptom?
I thought global 
destruction only happens when the server is shutdown or a child server dies, but 
these messages came out upon the very first request since the server restarts, 
and makes no sense too me. 
After I turn off 
PerlWarn, our CGIs that were broken start to work again. Sincethe messages in 
error.logare only warning message, how come the page is broken. Does 
PerlWarn outputs anything to places other than error.log?
Welcome any 
help.
June 
Young

June Young, Software 
Development 
bus: (902)422-1973 x144Dymaxion Research Ltd., 5515 Cogswell 
St., fax: (902)421-1267Halifax, Nova Scotia, 
B3J 1R2 
Canadamailto: 
[EMAIL PROTECTED]http://www.dymaxion.ca