[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] awww, no fun :(



Michael G Schwern <schwern@pobox.com> wrote:

> A much less odd implementation...
> 
> {
>   my $Caught_SIGINT = 0;
>   local $SIG{INT} = sub { $Caught_SIGINT = 1 };
> 
>   while(...) {
>     ...
>     last if $Caught_SIGINT;
>     ...
>   }
> }

That's not the same.  Randal's breaks out of the loop when the 
signal handler is called.  Yours doesn't break out until the 
last() after the the signal handler is called.

But something similar to Randal's could be done with eval() and 
die().

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe