I would prefer the system() over the qx//. Apart from being more secure, you can test whether the command was successful. At the moment, you are using qx// in void context : capturing the output of the command and ingoring it. This is a waste of memory and CPU cycles.
I'd write it thus:
{ system("tar", "zxvf", $ARGV[0] . "/$list[$d]") == 0 or print STDERR "Error running tar zxvf on $list[$d]"; $i++; }
my €0.02
In reply to Re: Re: Re: Yet Another Tar-Gzip File Expander
by Anonymous Monk
in thread Yet Another Tar-Gzip File Expander
by straywalrus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |