Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: LWP::UserAgent interaction w/ Archive::Zip

by SparkeyG (Curate)
on Jul 10, 2001 at 22:43 UTC ( #95414=note: print w/ replies, xml ) Need Help??


in reply to LWP::UserAgent interaction w/ Archive::Zip

Okay, the IO::Scalar pointer has helped, now I am getting a unblessed reference error when I attempt to pass it to  $zip->read()
Here is a revised code and the error:

my $SH = IO::Scalar->new(); $SH->open (\$res->content()); # my $SH = tie *ZIP, 'IO::Scalar', \$res->content(); my $zip = Archive::Zip->new(); die ("Error reading Zip File : $!\n") if $zip->read ( \$SH ) != A +Z_OK; # die ("Error reading Zip File : $!\n") if $zip->read ( \*ZIP ) != + AZ_OK;

The error, w/ use diagnostics:
Can't call method "isa" on unblessed reference at /opt/perl/lib/site_perl/5.6.1/Archive/Zip.pm line 624 (#1)

And if anyone cares, the offending code from Archive::Zip:
if ( ref( $fd ) ) { if ( $fd->isa( 'IO::Handle' ) or $fd->isa( 'GLOB' ) ) { $status = $handle->fdopen( $fd, @_ ); } else { $handle = $fd; } }

--SparkeyG
A humble monk over his head.


Comment on Re: LWP::UserAgent interaction w/ Archive::Zip
Select or Download Code
Re2: LWP::UserAgent interaction w/ Archive::Zip
by bikeNomad (Priest) on Jul 11, 2001 at 03:15 UTC
    What you do is what I've done in the 0.12 version of Archive::Zip that I'm going to upload to CPAN Real Soon Now.

    You can fix _newFileHandle, but you'll run into problems (I think) when it goes to look at the file name. I've made a number of changes since 0.11; some of them have to do with reading from IO::Scalars. If you want to try out the latest version, you can try an almost-finished one at ftp://ftp.bike-nomad.com/public/Archive-Zip-0.12.tar.gz. I'd be interested to get your feedback.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2015-07-02 08:29 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 (31 votes), past polls