Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: problem web xml file

by sunja (Initiate)
on Jul 01, 2012 at 22:15 UTC ( #979345=note: print w/ replies, xml ) Need Help??

in reply to problem web xml file

hmm well I got it worked out I think. thanks for all the help!

sub g_zip { my $file = $_; my $data; my $ptr = new IO::Uncompress::Gunzip($file) or die $!; while (defined (my $line = $ptr->getline())) { $data .= $line; } $ptr->close(); return $data; }

Comment on Re: problem web xml file
Download Code
Replies are listed 'Best First'.
Re^2: problem web xml file
by ig (Vicar) on Jul 02, 2012 at 05:51 UTC

    There's nothing wrong with unzipping it yourself, but another option is to use LWP::UserAgent and let it handle the decoding.

    #!C:/strawberry/perl/bin/perl.exe # use strict; use warnings; use LWP::UserAgent; my $url = ' +F998&part=items'; my $ua = LWP::UserAgent->new(); my $response = $ua->get($url); if($response->is_success) { print $response->decoded_content; } else { die $response->status_line; }

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2015-10-04 05:12 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (99 votes), past polls