Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Stopping execution of an eval statement

by kwaping (Priest)
on Jul 23, 2005 at 15:03 UTC ( [id://477485]=note: print w/replies, xml ) Need Help??


in reply to Stopping execution of an eval statement

Dang, davidrw beat me to it...
#!/usr/bin/perl use strict; use warnings; $|++; use vars qw($go); $SIG{'INT'} = 'stop_counting'; $go = 1; my $code = q|my $x = 0; while ($go) { print"$x\n"; $x++; }|; eval($code); print "done counting!\n"; print $@ if ($@); sub stop_counting { $go = 0; print "\n\nstopping eval...\n"; } exit;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://477485]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-03-29 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found