You said that you only saw "AAA" as output. That's interesting, as your porgram cannot even run as it is.
Other than some of the obvious problems. It is usually a good idea to return array ref instead of array.
use strict; sub job { my $row= ["AAA","BBB"]; return $row; } my $red =job(); foreach my $r(@$red) { print $r, "\n"; }
In reply to Re: Subroutine - Return Array
by PeterPeiGuo
in thread Subroutine - Return Array
by Sachin_dada
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |