lib/CPAN/lib/CGI/Session/Serialize/storable.pm
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 package CGI::Session::Serialize::storable;
     2 
     3 # $Id: storable.pm 351 2006-11-24 14:16:50Z markstos $
     4 
     5 use strict;
     6 use Storable;
     7 require CGI::Session::ErrorHandler;
     8 
     9 $CGI::Session::Serialize::storable::VERSION = "4.20";
    10 @CGI::Session::Serialize::ISA               = ( "CGI::Session::ErrorHandler" );
    11 
    12 =pod
    13 
    14 =head1 NAME
    15 
    16 CGI::Session::Serialize::storable - Serializer for CGI::Session
    17 
    18 =head1 DESCRIPTION
    19 
    20 This library can be used by CGI::Session to serialize session data. Uses L<Storable|Storable>.
    21 
    22 =head1 METHODS
    23 
    24 =over 4
    25 
    26 =item freeze($class, \%hash)
    27 
    28 Receives two arguments. First is the class name, the second is the data to be serialized.
    29 Should return serialized string on success, undef on failure. Error message should be set using
    30 C<set_error()|CGI::Session::ErrorHandler/"set_error()">
    31 
    32 =cut
    33 
    34 sub freeze {
    35     my ($self, $data) = @_;
    36     return Storable::freeze($data);
    37 }
    38 
    39 =item thaw($class, $string)
    40 
    41 Receives two arguments. First is the class name, second is the I<frozen> data string. Should return
    42 thawed data structure on success, undef on failure. Error message should be set
    43 using C<set_error()|CGI::Session::ErrorHandler/"set_error()">
    44 
    45 =back
    46 
    47 =cut
    48 
    49 sub thaw {
    50     my ($self, $string) = @_;
    51     return Storable::thaw($string);
    52 }
    53 
    54 =head1 LICENSING
    55 
    56 For support and licensing see L<CGI::Session|CGI::Session>
    57 
    58 =cut
    59 
    60 1;