home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / dump.al < prev    next >
Encoding:
Text File  |  2003-09-17  |  1.1 KB  |  38 lines

  1. # NOTE: Derived from blib\lib\CGI\Session.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package CGI::Session;
  5.  
  6. #line 899 "blib\lib\CGI\Session.pm (autosplit into blib\lib\auto\CGI\Session\dump.al)"
  7. # $Id: Session.pm,v 3.12.2.7.2.4 2003/07/26 13:49:16 sherzodr Exp $
  8.  
  9.  
  10. # dump() - dumps the session object using Data::Dumper.
  11. # during development it defines global dump().
  12. sub dump {
  13.     my ($self, $file, $indent) = @_;
  14.  
  15.     require Data::Dumper;
  16.     local $Data::Dumper::Indent = $indent || 2;    
  17.  
  18.     my $d = new Data::Dumper([$self], [ref $self]);
  19.  
  20.     if ( defined $file ) {
  21.         unless ( open(FH, '<' . $file) ) {
  22.             unless(open(FH, '>' . $file)) {
  23.                 $self->error("Couldn't open $file: $!");
  24.                 return undef;
  25.             }
  26.             print FH $d->Dump();
  27.             unless ( CORE::close(FH) ) {
  28.                 $self->error("Couldn't dump into $file: $!");
  29.                 return undef;
  30.             }
  31.         }
  32.     }
  33.     return $d->Dump();
  34. }
  35.  
  36. # end of CGI::Session::dump
  37. 1;
  38.