in reply to Sub ref from string without eval
#!/usr/bin/perl use strict; use warnings; # install within block to temporarily # turn off strict refs { no strict 'refs'; *{'Foo'} = sub { print "Hello, world!\n"; }; } my $foo = \&Foo();
EDIT: Forgot about strict 'refs'
In Section
Seekers of Perl Wisdom