shmem has asked for the wisdom of the Perl Monks concerning the following question:

There's a facility to resolve lexical function/method lookup via %^H at runtime - pragma. Subroutine dispatching can be handled e.g. via inspection of %^H inside an AUTOLOAD block. Is there such a way for lookup of other typeglob entries? If not, shouldn't that be implemented, if only for the sake of orthogonality?

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Replies are listed 'Best First'.
Re: pragma and typeglobs
by stevieb (Canon) on Aug 08, 2017 at 21:46 UTC

    I'm intrigued. I've never run into the need, nor have I ever read that doc before. For that reason (ie. lack of insight/knowledge), do you have any example use cases for doing this with other typeglobs that you could share that you think could be useful?

    Perhaps with some scenarios, the less-knowledgeable monks in this area may have some thoughts on your latter question.

      This is about an attempt to make packages lexically scoped. See RFC: pragma pragmatic; follow-ups there please ;-)

      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'