--- Coro/eg/event 2001/07/27 02:51:33 1.8 +++ Coro/eg/event 2007/04/14 15:06:06 1.11 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# this crap is an asynchroneous finger client. it's rather idiotic ;) +# this crap is an asynchronous finger client. it's rather idiotic ;) use Coro; use Coro::Event; @@ -12,7 +12,7 @@ my $host = shift; my $fh = new Coro::Socket PeerHost => $host, PeerPort => "finger" - or die; + or die "$user\@$host: $!"; print $fh "$user\n"; @@ -40,6 +40,8 @@ } } +async { finger("root", "localhost") }; + # display the time or garble the display, YMMV. sub timer : Coro { my $w = Coro::Event->timer(interval => 0.001, hard => 1); @@ -50,5 +52,6 @@ }; } +cede; # make sure the watchers are installed print "unlooped with value: ",loop(),"\n";