Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

pragma and typeglobs

by shmem (Chancellor)
on Aug 08, 2017 at 20:08 UTC ( #1197036=perlquestion: print w/replies, xml ) Need Help??
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 (Abbot) 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'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1197036]
Approved by marto
Front-paged by marto
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2017-10-23 00:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (275 votes). Check out past polls.

    Notices?