Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^5: Anonymous Hash in Constructor

by tobyink (Abbot)
on Oct 19, 2012 at 23:09 UTC ( #1000067=note: print w/replies, xml ) Need Help??

in reply to Re^4: Anonymous Hash in Constructor
in thread Anonymous Hash in Constructor

Then this will blow your mind...

sub x { print {+shift} "this is a method happening\n" } bless \*STDOUT, main::; (\*STDOUT)->x;
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^6: Anonymous Hash in Constructor
by Jim (Curate) on Oct 19, 2012 at 23:42 UTC

    Then will this blow yours?

    sub new { print {+shift} "This is a method happening.\n" } bless \*STDOUT; (\*STDOUT)->new;

    Probably not.

    (I'd have to have this explained to me to understand it.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000067]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2017-08-18 00:13 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (294 votes). Check out past polls.