cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
But when the file is large or I have a lot of other things running on my machine, the $response can cause memory shortages. I'm wondering if there is a way to stream the response straight to a file, i.e. like you can do with the get method usinguse WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get($url); if ($mech->success()) { $mech->form_number(1); my $response = $mech->click_button(name => 'begin'); open(OUT,">save.zip") or die "Can't open outfile: $!\n"; binmode OUT; print OUT $response->content(); close OUT; }
only in response to click_button$mech->get($url, ":content_file" => "filename.here");
Thanks...Steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW:Mechanize click_button stream to file?
by jettero (Monsignor) on Feb 12, 2007 at 14:43 UTC | |
by cormanaz (Deacon) on Feb 12, 2007 at 14:50 UTC | |
|
Re: WWW:Mechanize click_button stream to file?
by lorn (Monk) on Feb 12, 2007 at 19:24 UTC | |
by Anonymous Monk on Feb 13, 2007 at 00:56 UTC | |
|
Re: WWW:Mechanize click_button stream to file?
by Anonymous Monk on Feb 13, 2007 at 00:57 UTC | |
by Qiang (Friar) on Feb 13, 2007 at 18:47 UTC | |
by Qiang (Friar) on Feb 13, 2007 at 19:17 UTC | |
by Anonymous Monk on Feb 14, 2007 at 09:34 UTC | |
by Qiang (Friar) on Feb 14, 2007 at 15:46 UTC |