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