Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 cooling their heels in the Monastery: (8)
As of 2014-07-31 23:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (255 votes), past polls