Can't locate "extract_file" via "Archive::Tar"
- From: usenet@xxxxxxxxxxxxxxx
- Date: 28 Apr 2006 17:48:21 -0700
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!
--
http://DavidFilmer.com
.
- Follow-Ups:
- Re: Can't locate "extract_file" via "Archive::Tar"
- From: DJ Stunks
- Re: Can't locate "extract_file" via "Archive::Tar"
- Prev by Date: Re: chomp hash keys?
- Next by Date: FAQ 5.32 How do I dup() a filehandle in Perl?
- Previous by thread: Detecting filehandles
- Next by thread: Re: Can't locate "extract_file" via "Archive::Tar"
- Index(es):
Relevant Pages
|