Have you ever tried to do essentially the same as you would in bash do to this:
parentapp &1 )
And found massive road works getting in the way.
Sure, you can aways do this style syntax:
open my $fh, 'someapp --args foo 2>&1 |';
But thats not very nice, because
1. you're relying on a subshell to do that for you
2. you have to manually escape everything
3. you can't use list context.
And none of this is very Modern or Nice
SYNOPSIS
use IPC::Run::Fused qw( run_fused );
run_fused( my $fh, $stderror_filled_program, '--file', $tricky_filename, amoreargs ) || die "Argh $a";
open my $fh, '>', 'somefile.txt' || die "NOO $a";
# Simple implementation of 'tee' like behaviour,
# sending to stdout and to a file.
while ( my $line = ) {
print $fh $line;
print $line;
}
Product's homepage
Requirements:
· Perl
Download IPC::Run::Fused 0.01028806 Free
Tags: capture stdout , capture stderr , Perl module , stderr , stdout , capture ,
$fh, $line, $a , open $fh, || die, open, die, run_fused, print, argh, nicesynopsis, noo $a, 'somefiletxt' || die, modern, 'somefiletxt', ipcrunfused, $tricky_filename, $stderror_filled_program, '--file', amoreargs, ·, list, contextand, perl, none

No comments:
Post a Comment