#!/usr/bin/perl use strict; use warnings; my @time=(4,12,16,8); LABELME: foreach my $t (@time) { $SIG{ALRM} = sub {print "timeout\n"; next LABELME}; print "Start $t\n"; alarm(10); sleep($t); alarm(0); print "done with $t\n"; } print "All Done!\n"; #### Start 4 done with 4 Start 12 timeout Exiting subroutine via next at postalarm.pl line 8. Exiting eval via next at postalarm.pl line 8. Label not found for "next LABELME" at postalarm.pl line 8.