develooper Front page | perl.beginners | Postings from February 2002

RE: Not your average system() question...

Thread Previous | Thread Next
Nikola Janceski
February 6, 2002 06:58
RE: Not your average system() question...
Message ID:

use :
$| =1;
open(COMMAND, " command | ");
	print STDOUT;
	## do whatever you want with $_
close COMMAND;

you can then read the output and print it and whatever.

-----Original Message-----
From: []
Sent: Wednesday, February 06, 2002 9:54 AM
Subject: Not your average system() question...

I understand how the system command works.  I understand the
difference between system() and backticks.  My question is this:
I want to make a call to an external program and I want the output
printed to the command line as it is processing, BUT, I also want
the output returned to me so that I can parse and check it for certain
conditions.  Basically I need the functionality of both system() and
backticks.  How do I accomplish this?  I looked into redirecting
STDOUT, but didnt see how it was possible.

     Kevin Schmidt
     Cincinnati, OH


NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be

To unsubscribe, e-mail:
For additional commands, e-mail:

The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About