--- AnyEvent/eg/handle 2008/05/15 07:51:25 1.1 +++ AnyEvent/eg/handle 2009/08/06 14:00:36 1.4 @@ -1,4 +1,5 @@ #!/opt/bin/perl + # This small example script shows how to do non-blocking # reads from a file handle. @@ -8,12 +9,11 @@ my $ae_fh = AnyEvent::Handle->new ( fh => \*STDIN, - on_eof => sub { $cv->broadcast } + on_error => sub { $cv->broadcast } ); -$ae_fh->push_read_line (sub { +$ae_fh->push_read (line => sub { my ($ae_fh, $line) = @_; - chomp $line; print "Got line [$line]\n"; $ae_fh->push_read (sub {