Plankton has asked for the wisdom of the Perl Monks concerning the following question:
Later on in the script I set a cookie to maintain the state of the download. If the download is not complete I simply "shell out" to grep awk and tail of the wget log file to get the status of the download. I hope there is a Monk that can help with my bad habits.if ( $download_status eq "START" ) { my $wgetcmd = "wget -o $download_log -O $zipfile -b $zipurl"; system ( $wgetcmd ) == 0 or die __FILE__ . " [" . __LINE__ . "] cannot execute $wgetcmd : +$!\n"; sleep 1; my $shell_out = <<`SHELL`; grep Length $download_log | awk '{print \$3}' SHELL $download_size = $shell_out; }
|
|---|