P
prabhu.subramaniam
Hi,
I am trying to store an object (WWW::Mechanize) in
session(CGI::Session) and trying to retrieve it, but I am encountering
the following problem:
Prog:
my $mech = WWW::Mechanize->new ( );
if(request is from pagel)
{
$session = new CGI::Session("driver:File", undef,
{Directory=>'/tmp'});
$mech->get("www.someurl.com"); #works fine
$session->param('Mech', $mech);
}
elseif(request is from page2)
{
$sid = param('CGISESSID') || undef;
$session = new CGI::Session("driver:File", $sid,
{Directory=>'/tmp'}); #able to get other data passed from page1
$mech = $session->param('Mech');
$mech->get("www.someotherurl.com");
}
When I am in first page things are fine. In second page, I get
"Can't locate object method "get" via package "WWW::Mechanize" at
C:\Inetpub\Scripts\somescript.pl line 100."
I am a beginner to Perl and I am not able to find any resources to
solve my problem. It is important that I reuse the same object($mech
from page1's call). Your help on this is greatly appreciated. Thanks.
Regards,
Prabhu
I am trying to store an object (WWW::Mechanize) in
session(CGI::Session) and trying to retrieve it, but I am encountering
the following problem:
Prog:
my $mech = WWW::Mechanize->new ( );
if(request is from pagel)
{
$session = new CGI::Session("driver:File", undef,
{Directory=>'/tmp'});
$mech->get("www.someurl.com"); #works fine
$session->param('Mech', $mech);
}
elseif(request is from page2)
{
$sid = param('CGISESSID') || undef;
$session = new CGI::Session("driver:File", $sid,
{Directory=>'/tmp'}); #able to get other data passed from page1
$mech = $session->param('Mech');
$mech->get("www.someotherurl.com");
}
When I am in first page things are fine. In second page, I get
"Can't locate object method "get" via package "WWW::Mechanize" at
C:\Inetpub\Scripts\somescript.pl line 100."
I am a beginner to Perl and I am not able to find any resources to
solve my problem. It is important that I reuse the same object($mech
from page1's call). Your help on this is greatly appreciated. Thanks.
Regards,
Prabhu