On Fri, Nov 12, 2010 at 01:02:48PM +0100, Guillaume Rousse wrote:
> Le 12/11/2010 10:46, Gonéri Le Bouder a écrit :
> > Hi,
> >
> > A little Perl question. Do you know if it possible to catpure STDERR with
> > this syntax:
> > if (open my $handle, "-|", "ddcprobe") {
> > ...
> > }
> Redirect stderr output to stdin: open ($handle, '|', 'dccprobe 2>&1').
This doesn't work:
Unknown open() mode '|'
This is what I did finally:
my $handle;
if ($file) {
open $handle, '<', $file or die;
} else {
open ($handle, "ddcprobe 2>&1 |")
}
foreach (<$handle>) {
Best regards,
Gonéri
signature.asc
Description: Digital signature
_______________________________________________ Fusioninventory-devel mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/fusioninventory-devel
