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

Re^2: undef/defined &{$name} while "strict refs"

by anazawa (Scribe)
on Aug 21, 2012 at 03:22 UTC ( #988560=note: print w/replies, xml ) Need Help??


in reply to Re: undef/defined &{$name} while "strict refs"
in thread undef/defined &{$name} while "strict refs"

Thanks to your explanation, I understand "strict refs" allows the following:
my $runable = \&{ 'run' }; &$runable;
Your code shows how we avoid throwing exceptions. I think, however, it's still unclear why defined/undef &{ 'run' } doesn't throw exceptions while "strict refs".

Replies are listed 'Best First'.
Re^3: undef/defined &{$name} while "strict refs"
by Anonymous Monk on Aug 21, 2012 at 06:43 UTC

    I think, however, it's still unclear why defined/undef &{ 'run' } doesn't throw exceptions while "strict refs". ,/i>

    Have you read what strict says about refs?

    Please read it now

      The POD says we are allowed to get a reference to CODE using symbolic references while "strict refs". I think this doesn't mean we can defined or undef subroutines as well. I may be misreading the document.

        I think this doesn't mean we can defined or undef subroutines as well.

        I don't understand what you're saying here

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988560]
help
Chatterbox?
marioroy I once fell asleep while drive and had no collection on how I exited the ramp. Then called my wife not knowing where I was totally lost.
marioroy At a large firm, had to awaken a security guy a few times so that nobody would catch him sleeping.
marioroy On a large dairy farm, almost went off the road with a 10 wheeler from exhaustion. On the farm, almost went off the silo with a big tractor. At the Fransiscan monastery, almost slipped off the dome while painting it.
[marioroy]: In Saudi Arabia caught fire but didn't burn. I think angels exist.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-05-29 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?