#!/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 reply to Re: Sub ref from string without eval
by stevieb
in thread Sub ref from string without eval
by lackita
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |