P
paul.porcelli
Hi there,
suppose I create an array of arryanames
@testarr=qw/@arr1 @arr2 @arr3/;
The I assign values to those arrays
@arr1=`ls /tmp`;
@arr2=`ls /var`;
Now I want to loop and print the first value in each array
foreach $val (@testarr) {
print $val[0];
}
The above does not work.
Is there another way this can be done ?
Many thanks.
suppose I create an array of arryanames
@testarr=qw/@arr1 @arr2 @arr3/;
The I assign values to those arrays
@arr1=`ls /tmp`;
@arr2=`ls /var`;
Now I want to loop and print the first value in each array
foreach $val (@testarr) {
print $val[0];
}
The above does not work.
Is there another way this can be done ?
Many thanks.