http://www.perlmonks.org?node_id=621264


in reply to Re: Automated downloading of NOAA radar images
in thread Automated downloading of NOAA radar images

Thanks for the tip, merlyn, I have "refactored" my code as follows:

use strict; use LWP::Simple; use POSIX; my $refresh = 1800; { &imagegrab; sleep $refresh; redo; } sub imagegrab { my $base="http://radar.weather.gov/ridge/RadarImg/N0R/MTX_N0R_0.gi +f"; my $timestring = strftime( "%Y%m%d_%H%M%S", gmtime() ); my $savefilename = "SLCRadar_".$timestring.".gif"; my $status = getstore($base,$savefilename); print $status."\n" ; }

It does seem a cleaner way to handle this...