To capture output you need the backticks 

my @output = `put your command here`;

The return value of a system call is the return value of the program you call.

See perldoc perlfaq8 for more info

Jim

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 25 May 2004 18:45
To: [EMAIL PROTECTED]
Subject: array population from system app call


All, 

was hoping anyone could provide some syntax help.

I want to populate an array from a system app call like so.... and then 
print out each element.


my @ftapes = system ("evmvol -w label_state=3|grep barcode");
print $ftapes[0]


or 

print $ftapes[0,1]

The problem is it prints out all the lines for print $ftapes[0] and does 
not print for print $ftapes[0,1]


OR 
should I just run the system call,  put it to a file
then open the file,  read line by line 
chomp
foreach $_
print $_
close file

thanks
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to