Can't locate "extract_file" via "Archive::Tar"

U

usenet

I created a small test tarball using this UNIX command:

cd /tmp; ls >ls1.txt; ls >ls2.txt; tar czvf testing.tar.gz ls?.txt

I then ran this simple test script against it:

#!/usr/bin/perl
use strict; use warnings;
use Archive::Tar qw{ extract_file };

my $tar = Archive::Tar -> new;
$tar -> read('/tmp/testing.tar.gz') or die $!;

print "$_\n" for $tar -> list_files(); #it works.

$tar -> extract_file('ls1.txt'); # oops!

__END__

The script fails with this error:
Can't locate object method "extract_file" via package "Archive::Tar"
at...

That is, however, a valid method according to the perldocs:
http://search.cpan.org/~kane/Archive-Tar-1.29/lib/Archive/Tar.pm
and I did specifically import it (though I don't think I need to, and
it doesn't matter either way).

What am I doing wrong?

Thanks!
 
D

DJ Stunks

#!/usr/bin/perl
use strict; use warnings;
use Archive::Tar qw{ extract_file };

<snip>

The script fails with this error:
Can't locate object method "extract_file" via package "Archive::Tar"
at...

Sorry dude, I'm unable to reproduce it.

C:\tmp>perl -v | grep 5.8
This is perl, v5.8.7 built for MSWin32-x86-multi-thread

C:\tmp>perl -MArchive::Tar -e "print $Archive::Tar::VERSION"
1.23

-jp
 
U

usenet

DJ said:
Sorry dude, I'm unable to reproduce it.
C:\tmp>perl -MArchive::Tar -e "print $Archive::Tar::VERSION"
1.23

I guess I should have checked that - I was using Archive::Tar version
1.08. It seems the extract_file method wasn't part of that version - I
upgraded to 1.23 and all is well.

Thanks!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top