Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Disable LWP::Simple's autodeflating?

by BrowserUk (Patriarch)
on Jan 31, 2013 at 07:00 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1016235]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-24 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found