- or download this
select(STDERR);$|=1;select(STDOUT);$|=1; # autoflush
print "This is the prompt: ";
my $input = <STDIN>;
print "done.\n";
- or download this
select(STDERR);$|=1;select(STDOUT);$|=1; # autoflush
$cmd = 'perl b.pl 2>&1';
system($cmd);
- or download this
select(STDERR);$|=1;select(STDOUT);$|=1; # autoflush
$cmd = 'perl b.pl 2>&1 |';
open(CMD, $cmd) or die "error: open '$cmd': $!\n";
while (<CMD>) { print } # and print to log file here too
close(CMD);
- or download this
select(STDERR);$|=1;select(STDOUT);$|=1; # autoflush
$cmd = 'perl b.pl 2>&1 | tee -a logfile.txt';
system($cmd);