sub MyFunc { my @ary = qw(a b c d e f g h i j); return \@ary; } my $foo = ${MyFunc()}[4];