Title: Message
Hi, 
 
We are running 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 simple CGI script, and that CGI script works fine in mod_perl. 
 
After adding quotes outside of the regex of split function in sub VMSify, the error went away. We could not figure out why the statement bombs out in our VMSify function and 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></head><body>\n";
 

Test();
 
sub Test{
   foreach (@::INC) {
      VMSify($_);
   }
}
 
sub VMSify{
   my @subDirs;
   my $directory=uc(shift);
 
   $directory=~s/^\/|\/$//g;
      print "dir=$directory\n<br>";
#   @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\n<br>";
   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 x144
Dymaxion Research Ltd., 5515 Cogswell St.,      fax: (902)421-1267
Halifax, Nova Scotia, B3J 1R2 Canada           mailto: [EMAIL PROTECTED]
http://www.dymaxion.ca
 
 

Reply via email to