#!/usr/bin/perl -w for my $i (4..200){ eval { local $SIG{ALRM} = sub{die "alarm\n"}; alarm 5*60; system("wget -O rem$i.txt http://www.elecciones2006.unam.mx/PREP2006/index_contenido.html"); alarm 0; }; if($@){ print "error: $@"; }else{ sleep 5*60; } }