Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Archive::Tar is working with perl-5.8.7 but giving Out Of Memory error with perl-5.20.1

by afoken (Chancellor)
on Mar 30, 2015 at 13:08 UTC ( [id://1121825]=note: print w/replies, xml ) Need Help??


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

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re: Archive::Tar is working with perl-5.8.7 but giving Out Of Memory error with perl-5.20.1
  • Select or Download Code

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
    After further investigation I found that this program run successfully with 64 bit perl. I downloaded .msi files of 32 bit and 64 bit perl of both ActiveState and Strawberry distribution. For 64 bit ActiveState and Strawberry perl this program completes successfully. However for 32 bit ActiveState and Strawberry perl this program gives out of memory error. I think this issue is somehow related with Perl binary rather than Archive::Tar module. Can anyone please help here ?

      I think this issue is somehow related with Perl binary rather than Archive::Tar module. Can anyone please help here ?

      No, the issue is the same, Archive::Tar slurps, needs lots of memory, 64 bit exes have access to more ram than 32 bit exes

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1121825]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 11:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found