in reply to Subroutine - Return Array

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"; }

Peter (Guo) Pei