Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Detecting declaration type?

by tobyink (Abbot)
on Sep 17, 2012 at 22:38 UTC ( #994138=note: print w/ replies, xml ) Need Help??


in reply to Detecting declaration type?

OK, this ain't pretty...

use 5.010; use Lexical::Types; use Hash::FieldHash qw(fieldhash); BEGIN { fieldhash %::_TYPE_TRACKER } BEGIN { package Foobar; sub TYPEDSCALAR { $::_TYPE_TRACKER{\$_[1]} = $_[2] } } my Foobar $foo = "Hello"; say $::_TYPE_TRACKER{ \$foo };
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: Detecting declaration type?
Download Code
Re^2: Detecting declaration type?
by LanX (Canon) on Sep 18, 2012 at 18:16 UTC
    Thanks a lot!

    I didn't expect to even get two good answers! :)

    Cheers Rolf

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-11-28 18:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (199 votes), past polls