use strict; sub foo { "@_" } my ($x, $y) = qw/ f oo /; print __PACKAGE__->${\($x . $y)}('FOO'); __END__ main FOO