$SIG{ALRM} = sub { die "timeout" }; eval { alarm(300); # do stuff here alarm(0); }; if($@) { if($@ =~ /timeout/) { # # Call our alrm_hdlr subroutine, we were hung up # alrm_hdlr(); } else { alarm(0); die; } } # continue on, manipulate data, etc... sub alrm_hdlr { # Handle the fact that we got hung up }
In reply to Re: Net::Ping not working
by BastardOperator
in thread Net::Ping not working
by geektron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |