Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: subroutine ref while "strict refs"

by Anonymous Monk
on Jul 28, 2014 at 20:22 UTC ( [id://1095416]=note: print w/replies, xml ) Need Help??


in reply to Re: subroutine ref while "strict refs"
in thread subroutine ref while "strict refs"

\&$_ is except from strict refs

Very good point, although I think (?) that's just a specific case of the more general exemption my $x = "foo"; my $y = \&$x; &$y; or my $y = \&{"foo"}; &$y;

Replies are listed 'Best First'.
Re^3: subroutine ref while "strict refs"
by ikegami (Patriarch) on Jul 28, 2014 at 21:17 UTC

    I didn't mean to be exclusionary. \&{EXPR} as a whole is exempt, including the \&$NAME shorthand. CONST->() is also exempt.

    For example, (\&$name)->() is the same as $name->(), but it bypasses the symbolic reference check requested by using strict.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-24 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found