in reply to Re: getting data to a signal handler
in thread getting data to a signal handler
I figured out something that doesn't SEEM to use globals, but it probably does something much worse...
Run this and hit CTRL-C, it will print how many seconds it thinks it's been running
#! /usr/bin/perl -w -T use strict; my $var; ($var,$SIG{INT}) = voodoo(); sub voodoo { my $thing ; my $sub = sub { my $blob = \$thing; print $$blob."\n"; exit; }; return (\$thing,$sub); } for (my $i=0; $i<60 ;$i++) { $$var = $i; sleep 1; }
Let me know what sort of terrible thing I've done...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: getting data to a signal handler
by Zaxo (Archbishop) on Nov 19, 2005 at 03:13 UTC | |
|
Re: getting data to a signal handler
by jonadab (Parson) on Nov 19, 2005 at 12:32 UTC |