Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: no strict refs for blocks?

by moritz (Cardinal)
on Nov 02, 2011 at 11:13 UTC ( #935354=note: print w/ replies, xml ) Need Help??


in reply to no strict refs for blocks?

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.


Comment on Re: no strict refs for blocks?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935354]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2015-08-01 01:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls