Hey Folks, Relatively new to perl, trying to "push" the values from a loop into an array; but it only loops once and stores only the first value - what am I doing wrong here? here is the excerpt from the script:
my @store; foreach my $line (@$lines) { my @val = split(/\,/,$line); push (@store,@val[2]); } printf "@store\n";
In reply to Store the outcome of a foreach loop in an array by perl_5eeker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |