- or download this
use Capture::Tiny 'tee';
my $output = tee { system('t=1;while [ 1 -eq 1 ]; do echo hello $t; if
+ [ $t -eq 10 ]; then exit 0; fi; t=$((t+1)); sleep 1; done') };
print $_ while( <$output> );
- or download this
use strict;
use warnings;
...
}
}
print "$0 : done.\n";
- or download this
# example use:
perl a.pl &
telnet localhost 20000