in reply to Archive::Tar is working with perl-5.8.7 but giving Out Of Memory error with perl-5.20.1
if($tar_engine == undef)
Not related to your problem, but that code does not do what you expect it to do. Numeric equal (==) forces numeric context on both sides, so essentially you are comparing $tar_engine with 0. Perl warns you about this problem if you use warnings. You want to use defined($tar_engine) instead of $tar_engine == undef.
Another problem:
if(!$tar_engine->extract(@filelist)) { my $ret = 1; print "\nError in extraction.\n"; }
The scope of my $ret is limited to the block following if. Outside that block, $ret is either not defined at all or its value stays unchanged.
I suspect that your script runs without strict and warnings, so there may be more hidden errors. Try adding use strict; and use warnings; to the top of your code and fix problems until perl stops whining.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Archive::Tar is working with perl-5.8.7 but giving Out Of Memory error with perl-5.20.1
by Sushant_K (Initiate) on Apr 29, 2015 at 06:28 UTC | |
by Anonymous Monk on Apr 29, 2015 at 06:39 UTC |