in reply to Re^3: Zip file from WWW::Mechanize
in thread Zip file from WWW::Mechanize

$mech = WWW::Mechanize->new(); $mech->quiet(0); $mech->agent_alias( 'Windows IE 6' ); $r = HTTP::Request->new( POST => "https://my.bandwidth.com" ); $r->content("/portal/"); $mech->request($r)->content; ... ... ... $matches[0] =~ /href.*?=.*?\"(.*?)\"/; print "Link: $1\n"; $getreport="https://my.bandwidth.com/portal/Members/Voice/$1"; $mech->get($getreport); $content=$mech->content; save_to_file($content, 'decode.zip', 1); sub save_to_file { my $xcontent = shift; my $filename = shift; open (LOG, ">$filename"); binmode LOG; print LOG $xcontent; close(LOG); }