- or download this
#!/usr/bin/perl -w
use strict;
use IPC::Open3;
...
waitpid( $pid, 0 );
}
- or download this
Line 1
This is the first line
Line 2
This is the second line
Line 3
This is the third line
- or download this
sub test_mod {
my $line = shift;
...
local $\;
print STDOUT $content;
}
- or download this
STDOUT: Line 1
This is the first line
...
This is the third line
- or download this
sub single_thread {
for my $line (@_) {
my $pid = open3(my $wtr, my $rdr, undef, 'cat', '-v');
...
print "STDOUT: $content\n";
}
}
- or download this
STDOUT: Line 1
This is the first line
...
STDOUT: Line 3
This is the third line