cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
But for large files this takes a lot of memory, so I'd like to dump the file straight to disk.$response = mech->get($url); open(OUT,">$filename"); binmode $filename; print OUT $response->content; close OUT;
LWP::UserAgent, which is inherited by Mech, has a method called mirror, that is used thus
It seems from the docs like this should do the trick but when I try it with the same $url and $filename as in the above working example, nothing happens. Will this method not work for binary files on windoze? Is there some other approach I should use?$mech->mirror($url,$filename);
TIA...
Steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize write directly to file?
by grep (Monsignor) on Nov 26, 2006 at 16:39 UTC |