use warnings; use strict; sub testfunc(); { my $temp2=testfunc(); my @arr=@$temp2; print @arr, $temp2," \n" ; #want @arr to print the array elements & $temp2 to print ref value } sub testfunc() { my @temps= [1,2,3]; return \@temps; }