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

Re^5: Anonymous Hash in Constructor

by tobyink (Canon)
on Oct 19, 2012 at 23:09 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found