Skip to content

Instantly share code, notes, and snippets.

@Maki-Daisuke
Created December 16, 2010 03:19
Show Gist options
  • Save Maki-Daisuke/742977 to your computer and use it in GitHub Desktop.
Save Maki-Daisuke/742977 to your computer and use it in GitHub Desktop.
use AnyEvent::Handle;
my $c = AE::cv;
my $out = AnyEvent::Handle->new(fh => \*STDOUT);
my $in; $in = AnyEvent::Handle->new(
fh => \*STDIN,
on_read => sub{
my $hdl = shift;
$out->push_write($hdl->rbuf . "\n");
$hdl->rbuf = "";
}
);
$out->push_write("Start\n");
$c->recv;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment