Код | sub test{ use WWW::Mechanize; use HTTP::Cookies; use Storable; my $cookies = new HTTP::Cookies (file => "object/test", autosave => 1, ignore_discard => 1); my $mech = WWW::Mechanize->new(); $mech->agent($ENV{HTTP_USER_AGENT}); $mech->cookie_jar($cookies); $url="http://www.top.ucoz.ru/"; my $step=1; print "step $step<br>"; if ($step==1){ $resp = $mech->get($url); store $resp, "object/test.txt"; } if ($step==2){ $resp = retrieve('object/test.txt'); } $content=$resp->decoded_content; print $content; exit; }
|
Сериализация $resp проходит удачно, но с сериализацией $mech я постиг неудачу. Есть ли способ сериализировать такой объект как $mech? |