/usr/share/doc/libio-async-perl/examples/readwrite-futures.pl is in libio-async-perl 0.70-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/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;
|