in reply to use slack;
I hate to turn off strict. Why use strict
if you are only going to turn it off ?
I usually do this:
The reason this works is because the construct \&{$func} is exempt from the rule of strict references. It is as far as I know not documented in earlier perls, but code support for this construct has been in for a long time. It is documented in bleadperl IIRCuse strict; sub foo { print "bar\n" } my $func = "foo"; my $func_ref = \&{$func}; $func_ref->();
The construct is often used in AUTLOAD like this:
Autark.sub AUTOLOAD { # get params and function # ... my $func_ref = \&{$func}; goto &{$func_ref}; }
In Section
Seekers of Perl Wisdom