in reply to Re: Re: Yet Another Tar-Gzip File Expander
in thread Yet Another Tar-Gzip File Expander
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
|
|---|