Apache::Session::Serialize::Dumper - Use Data::Dumper to zip up persistent data


Apache-Session-Serialize-Dumper documentation Contained in the Apache-Session-Serialize-Dumper distribution.

Index


Code Index:

NAME

Top

Apache::Session::Serialize::Dumper - Use Data::Dumper to zip up persistent data

SYNOPSIS

Top

 use Apache::Session::Serialize::Dumper;

 $zipped = Apache::Session::Serialize::Dumper::serialize($ref);
 $ref = Apache::Session::Serialize::Dumper::unserialize($zipped);

DESCRIPTION

Top

This module fulfills the serialization interface of Apache::Session. It serializes the data in the session object by use of Data::Dumper's dump() and Perl's eval() functions. The result is a text object ready for storage.

AUTHOR

Top

This module was written by Pascal Fleury <fleury@users.sourceforge.net>.

SEE ALSO

Top

Data::Dumper Apache::Session::Serialize::Base64, Apache::Session::Serialize::Storable, Apache::Session


Apache-Session-Serialize-Dumper documentation Contained in the Apache-Session-Serialize-Dumper distribution.

#############################################################################
#
# Apache::Session::Serialize::Dumper
# Serializes session objects using Data::Dumper
# Copyright(c) 2000 Pascal Fleury (fleury@users.sourceforge.net)
# Distribute under the Artistic License
#
############################################################################

package Apache::Session::Serialize::Dumper;

use strict;
use vars qw($VERSION);
use Data::Dumper;

$VERSION = "0.90";

sub serialize {
    my $session = shift;
	 local $Data::Dump::Purity = 1;
	 local $Data::Dumper::Varname = "ASSD";
    $session->{serialized} = Dumper( $session->{data} );
}

sub unserialize {
    my $session = shift;

	 my $ASSD1;
	 eval $session->{serialized};
    $session->{data} = $ASSD1;
}

1;