I guess: You miss the "quit_program" condition?
Update: Like this:
#!/usr/bin/env perl use strict; use warnings; use AnyEvent; use feature qw (say); say q(Let's get schmorped!); my $amount = 10; my $quit_program = AnyEvent->condvar; my $timer = AnyEvent->timer( after => $amount, cb => sub { say qq(Awaiting penance in $amount s!); $quit_progr +am->send } ); $quit_program->recv; say q(Now we've been schmorped!); __END__ karls-mac-mini:playground karl$ ./event.pl Let's get schmorped! Awaiting penance in 10 s! Now we've been schmorped!
BTW: I couldn't install AnyEvent without -f.
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
In reply to Re: Basic question on AnyEvent
by karlgoethebier
in thread Basic question on AnyEvent
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |