Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: UNTAR in Perl

by chanakya (Friar)
on May 16, 2007 at 06:14 UTC ( #615697=note: print w/replies, xml ) Need Help??


in reply to UNTAR in Perl

anu7

This is a simple routine to extract the zip:
use Data::Dumper; unzip_tree($file); print Dumper \@files; sub unzip_tree{ my $zip_file = shift; my $zip = Archive::Zip->new($zip_file); $zip->extractTree( "", "$tmpdir/" ); my @files = grep { -f "$tmpdir/$_"} readdir( UNZIPED ) ; close UNZIPED; @files = map { $_ = "$tmpdir/$_" } @files; return @files; }
Hope this helps

Replies are listed 'Best First'.
Re^2: UNTAR in Perl
by graff (Chancellor) on May 16, 2007 at 14:41 UTC
    Um... Does Archive::Zip work on tar files? (I haven't tried that, but I would not expect it to work.)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2022-12-05 23:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?