use warnings; use strict; my ($x,$y,$z); sub foo { qw/a b c d/ } sub bar { my $a, $x, $y, $z = foo() } my @x = bar(); my $r = bar();