http://www.perlmonks.org?node_id=988560


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