Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > dd7abe7b73350e493f6a1e5f4326ce81 > files > 54

perl-IO-Async-0.600.0-2.mga4.noarch.rpm

#!/usr/bin/perl

use strict;
use warnings;

use IO::Async::Loop;
use IO::Async::Stream;

my $loop = IO::Async::Loop->new;

$loop->add( my $stdin  = IO::Async::Stream->new_for_stdin( on_read => sub { 0 } ) );
$loop->add( my $stdout = IO::Async::Stream->new_for_stdout );

$stdout->write( sub {
   return undef if $stdin->is_read_eof;
   return $stdin->read_atmost( 64 * 1024 );
})->get;