CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: how to store class object in perl session: Edit Log



pavan538
New User

Dec 28, 2012, 7:23 PM


Views: 2356
how to store class object in perl session

Emp.pm

Package Emp;
sub new {
my($class,$args )=@_;
my $self = bless{},$class;
$self->{name}=args->name;
$self->{id}=args->id;
return $self;
}
sub getName{
$self=shift;
return $self->{name};
}


thers is one session object

$session = new $session("driver::file",undef,{Directory=>"/tmp"};
$emp = new Emp({name=>'pavan',id=>101});
session->param("emp",$emp);

but it i open the session file from tmp directory it shows undef for emp.

is it possible to store the entire object of emp in session?


(This post was edited by pavan538 on Dec 28, 2012, 7:25 PM)


Edit Log:
Post edited by pavan538 (New User) on Dec 28, 2012, 7:25 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives