doubledecker has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

I'm using Archive::Tar Modules to extract tar files. For the first time, program is running successfully but when i run again, it is displaying errors on the screen. How to suppress them not to display on the screen and have a silent extraction

Also, how to find out return status of extraction?

use strict; use Archive::Tar; use File::Path qw(make_path remove_tree); my $file = '/home/rocket/sample.tgz'; my $dir = '/var/tmp/extract'; make_path("$dir") unless -d "$dir"; chdir($dir); my $ocs = Archive::Tar->new($file); my $stat = $ocs->extract(); print $stat;

Replies are listed 'Best First'.
Re: suppress errors from Archive::Tar
by Anonymous Monk on Jun 19, 2012 at 10:37 UTC

      works like a charm

      on the other hand, How to display all the errors during extraction

        on the other hand, How to display all the errors during extraction

        You tell me :)