in reply to Question on IO::UnCompress::GunZip...
#!/usr/bin/perl use strict; use warnings; use Archive::Extract; my $ae = Archive::Extract->new( archive => '/path/to/Archive-Extract- +0.38.tar.gz' ); my $ok = $ae->extract( to => '/path/to/Archive-Extract' ); my $files = $ae->files; my $outdir = $ae->extract_path; $ae->is_tgz; print $outdir, "\n"; chdir($outdir); my $lines = 0; my $filename = 'README'; die "Can't open '${filename}': $!" unless open FILE, $filename; while (sysread FILE, my $buffer, 4096) { $lines += ($buffer =~ tr/\n//); } close FILE; print "$lines\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Question on IO::UnCompress::GunZip...
by rementis (Beadle) on Jan 17, 2010 at 21:47 UTC | |
by Khen1950fx (Canon) on Jan 18, 2010 at 07:07 UTC | |
by Anonymous Monk on Jan 22, 2010 at 09:36 UTC | |
by pmqs (Friar) on Jan 23, 2010 at 19:38 UTC | |
by Anonymous Monk on Jan 22, 2010 at 09:45 UTC | |
by afoken (Chancellor) on Jan 23, 2010 at 18:26 UTC | |
by pmqs (Friar) on Jan 23, 2010 at 19:51 UTC |