and if you mean you want to pipe from the command line then the information goes to the filehandle <STDIN> which you can parse or print or do whatever.
open(P, 'parser |') || die "Can't run parser\n$!\n";
while(<P>){
print $_; # each line of output from parser will be in $_
} Mike
"Experience is the comb that Nature gives us after we are bald."
Is that a haiku?
I never could get the hang
of writing those things.
yes, it's like that Yauncin, but you get some more control as well, like this example from the documentation.
open(SPOOLER, "| cat -v | lpr -h 2>/dev/null"
|| die "can't fork: $!";
local $SIG{PIPE} = sub { die "spooler pipe broke" };
print SPOOLER "stuff\n";
close SPOOLER || die "bad spool: $! $?";
Mike
"Experience is the comb that Nature gives us after we are bald."
Is that a haiku?
I never could get the hang
of writing those things.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.