--- AnyEvent/eg/handle 2008/05/15 08:37:55 1.2 +++ 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,10 +9,10 @@ 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) = @_; print "Got line [$line]\n";