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 / clear.al < prev    next >
Encoding:
Text File  |  2003-09-17  |  1.1 KB  |  41 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 950 "blib\lib\CGI\Session.pm (autosplit into blib\lib\auto\CGI\Session\clear.al)"
  7. # clear() - clears a list of parameters off the session's '_DATA' table
  8. sub clear {
  9.     my $self = shift;
  10.     $class   = ref($self);
  11.     
  12.     my @params = ();
  13.  
  14.     # if there was at least one argument, we take it as a list
  15.     # of params to delete
  16.     if ( @_ ) {
  17.     @params = ref($_[0]) ? @{ $_[0] } : ($_[0]);
  18.     } else {
  19.     @params = $self->param();
  20.     }
  21.  
  22.     my $n = 0;
  23.     for ( @params ) {
  24.         /^_SESSION_/ and next;
  25.         # If this particular parameter has an expiration ticker,
  26.         # remove it.
  27.         if ( $self->{_DATA}->{_SESSION_EXPIRE_LIST}->{$_} ) {
  28.             delete ( $self->{_DATA}->{_SESSION_EXPIRE_LIST}->{$_} );
  29.         }
  30.         delete ($self->{_DATA}->{$_}) && ++$n;
  31.     }
  32.  
  33.     # Set the session '_STATUS' flag to MODIFIED
  34.     $self->{_STATUS} = MODIFIED;
  35.  
  36.     return $n;
  37. }
  38.  
  39. # end of CGI::Session::clear
  40. 1;
  41.