"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Instead of
$_; as the last line of the sub, try () It has to do with the return value of the sub, which is $_ in this case, and need to be an empty list if you want no output. The return value of the sub needs to be a list suitable for processing by the original file handle. In this case silence is an empty list. If all you want to do is capture the output, not process it, use the code from the Filter::Handle module Filter \*STDERR, sub {push @DATA, "@_"; ()}; noisy stuff occurs... UnFilter \*STDERR; @DATA now holds all the noise emitted on STDERR. In reply to Re: Re: Re: capturing STDERR within a script
by leriksen
|
|