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

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

Thread Previous | Thread Next
From:
Nikola Janceski
Date:
February 6, 2002 06:58
Subject:
RE: Not your average system() question...
Message ID:
1449413DA482D311B67000508B5A12F50592DCB6@nyexchange01.summithq.com

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

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

-----Original Message-----
From: kevin.schmidt@convergys.com [mailto:kevin.schmidt@convergys.com]
Sent: Wednesday, February 06, 2002 9:54 AM
To: beginners@perl.org
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.

     HELP PLEASE!
     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
corrected.



-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org

----------------------------------------------------------------------------
--------------------
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About