in reply to Why isn't the obvious dereferencing of the array working?

Just in case you don't know, the prototypes, in the case of your code, are the empty parentheses after the function declaration.

In addition, if you don't add these parens, you don't need to pre-declare your subroutine. So, your code could be:

use warnings; use strict; { 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; }
But it could also be:
use warnings; use strict; { 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; }

Je suis Charlie.