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

Please include some code; preferably the smallest amount possible that still reproduces your problem. Perhaps there is something inherently wrong with the code that extra eyes may see.

--MidLifeXis

The tomes, scrolls etc are dusty because they reside in a dusty old house, not because they're unused. --hangon in this post

Replies are listed 'Best First'.
Re^4: Zip file from WWW::Mechanize
by jck000 (Novice) on Mar 23, 2009 at 17:42 UTC
    $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); }