I would use:

my $cmd = 'cabarc.exe L '.$cabFile;
my (@list) = qx/$cmd/;
my $status = $?;
HandleError($status,join(' ',@list)) if $status;
foreach my $line (@list){
        # Do something
}



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of George
Gallen
Sent: Monday, October 06, 2003 9:56 AM
To: [EMAIL PROTECTED]
Subject: RE: Capturing the output of a sytem() command


Let me clarify ths slightly.

I'm using backticks to run the command, so I can capture the output.
But How do I read it sequentially, line by line.

I'm converting a file from ASCII -> BASE64, and want to read the
converted file directly from the base64 conversion routine.

I can use:  $output = `base64 -e ASCIIFILE -`
But how would I extract the line by line from $output?

George
-----Original Message-----
From: George Gallen [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003 10:40 AM
To: [EMAIL PROTECTED]
Subject: Capturing the output of a sytem() command


Am I able to capture the output of a system call?
Currently, I route the output to a temporary file,
then read the contents in when the call is done.
I'd rather not make a temp file.
George

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to