use strict; use warnings; sub somefunction { qw/foo bar 123/ } my @x = somefunction(); for (@x) { my $foo = "${_}_func"; *{;no strict 'refs'; \*$_} = sub { $foo }; } print &123(),$/; # omitting the & sigil gives syntax error __END__ 123_func #### *{ +do { no strict 'refs'; \*$_ } } = sub { # . . . };