sub x{return qw/e f g h 31/}; $a= @{[x()]}; # Force array context when calling sub print $a This prints the value 5