array population from system app call

DBSMITH_at_OhioHealth.com
Date: 05/25/04


To: beginners@perl.org
Date: Tue, 25 May 2004 13:45:11 -0400

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



Relevant Pages