Use a signal handler (perlipc).
use strict; use warnings; my $max; #-- set a signal handler $SIG{INT} = sub { print "Max: $max -- now leaving...\n"; exit 1; }; #-- main while (<>) { # do something that updates $max } print "Max: $max (finally)\n"; #-- normal termination (exit 0)
In reply to Re: Is This Possible?
by Perlbotics
in thread Is This Possible?
by jdlev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |