I am using the Perl code below to list files in a tar archive. The tar archive is always about 15 MB in size.
my $file = shift;
my $tar = Archive::Tar->new("$file");
my @lists = $tar->list_files;
$tar->error unless @lists;
Executing this code gives me an "Out of Memory" error. I have about 512 MB on my Linux system and I do not want to increase the memory of my system. Can someone please suggest me if this code can be modified to improve performance or other code to display files in a tar archive.
source
share