sub foo { my @array; return \@array; } my $a_ref = foo(); print scalar(@$a_ref); #this always seems to be 1...