RE: Capturing the output of a system() command

2003-10-08 Thread Erich C. Beyrent
 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

Hi there,

Here is what I do:

my $cmd = `base64 -e ASCIIFILE -`; 
 }

 open(APP, $cmd 21 |) or die Cannot run the command: $!\n; 
 while (APP)
 {
  print;
  $output .= $_;
 }
 close (APP);
 print \n;

-Erich-

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


RE: Capturing the output of a system() command

2003-10-06 Thread Rob Dowell




I have used this 
method with great success:

my $cmd = 
'cabarc.exe L '.$cabFile;my (@list) = qx/$cmd/;my $status = 
$?;HandleError($status,join(' ',@list)) if 
$status;

where HandleError is 
my own error handling routine.


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 





BEGIN:VCARD
VERSION:2.1
N:Dowell;Rob
FN:Rob Dowell
NICKNAME:me
ORG:CPI Corp.;IT
TITLE:Programmer/Analyst
TEL;WORK;VOICE:(314) 231-1575 x4786
TEL;PAGER;VOICE:[EMAIL PROTECTED]
ADR;WORK:;;1706 Washington Ave.;St. Louis;MO;63103
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:1706 Washington Ave.=0D=0ASt. Louis, MO 63103
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20030714T163749Z
END:VCARD