Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Disable LWP::Simple's autodeflating?

by BrowserUk (Pope)
on Jan 31, 2013 at 07:00 UTC ( #1016235=note: print w/ replies, xml ) Need Help??


in reply to Disable LWP::Simple's autodeflating?

Three possibilities:

  1. If you want the contents in a file, use getstore instead of get and writing it out yourself:
    perl -MLWP::Simple -e'getstore("file:/cpan/authors/id/P/PM/PMQS/Compre +ss-Raw-Zlib-2.060.tar.gz", "Compress-Raw-Zlib-2.060.tar.gz" )'
  2. Patch your copy of LWP::Simple with a new method (say: getRaw() ) that returns the content rather than the decoded content::
    sub getRaw ($) { my $response = $ua->get(shift); ## return $response->decoded_content if $response->is_success; return $response->content if $response->is_success; return undef; }
  3. use lwp-download [-a] <url> [<local path>]:
    lwp-download file:/cpan/authors/id/P/PM/PMQS/Compress-Raw-Zlib-2.060.t +ar.gz

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Disable LWP::Simple's autodeflating?
Select or Download Code
Re^2: Disable LWP::Simple's autodeflating?
by Anonymous Monk on Jan 31, 2013 at 09:10 UTC
    Thanks, BrowserUK, especially for point #2. I decided to go with LWP::UserAgent.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016235]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2015-07-06 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (84 votes), past polls