sub test { my $x = shift; my $y = shift; my $z = shift; print $x + $y + $z; } # output 6 apply(\&test, [1,2,3]);