Willy,
 
mod_perl 2 uses a different default directory from mod_perl 1.3.  May also be different from plain cgi also.
 
mp1 used E:\Apache2\bin
mp2 uses E:\Apache2
 
This gave me fits when I migrated from 1.3 to 2.
 
I think the error I was getting was file not found.
 
This works for writing:
 
sub _LogEntry {
  my ($aApobj, $Str) = @_;  
  if ($aApobj->getLogSQL == $aApobj->True()) {  # Skips if not turned on.
    use IO;
    my $log2 = $aApobj->getLogFile(); # 'vwLOG_FILE2.TXT';
    my $fh2 = new IO::File(">> $log2");
    unless ($fh2) {   die "DBAPPOBJ: Died opening log file $log2 to write $Str."; }
    print $fh2 $aApobj->DateTimeUS() . " $Str\n";
    $fh2->close();
  }
  return;
}
 
So, Try copying the file to different directories to see if it starts working.
 
Chuck
 
 
-----Original Message-----
From: Huilli Liu [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 2:07 PM
To: [EMAIL PROTECTED]
Cc: Huilli Liu
Subject: IO::File problem on Mod_perl

Hi All,
 
Recently I are migrating cgi to mod_perl but it is running out of the problem for IO::File.
Here are my original codes:
 
 my $template_file = new IO::File("templates/quickquote.templ");
 $template_file->input_record_separator(undef);
 my $template = <$template_file>;
 $template_file->close;
 
"templates/quickquote.templ" is under "DocumentRoot" directory but it looks like it can not find the file.
 
The error I got is as below:
 
[Wed Jun 16 16:52:46 2004] [error] [client 10.5.20.105] Can't call method "input_record_separator" on an undefined value at c:/Apache2/modperl/MyApache/StockList.pm line 628.
, referer: http://localhost:8080/stocklist
 
Is there anyone who has the experience for this problem?
Please give me some advices if you know how to fix it.
 
Thanks,
 
Willy
 
 

Reply via email to