The use strict 'refs'; is unneeded, because strict. Apart from that, it seems to do what you want: when strict refs are disabled, &$routine_name() calls the sub with name $routine_name:
$ perl -Mstrict -wE 'sub f { say "f" }; my $x = "f"; { no strict "refs +"; &$x() }; &$x()' f Can't use string ("f") as a subroutine ref while "strict refs" in use +at -e line 1.
In reply to Re: no strict refs for blocks?
by moritz
in thread no strict refs for blocks?
by Sewi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |