Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: Dynamic names

by cdarke (Prior)
on Nov 18, 2010 at 10:22 UTC ( #872180=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Dynamic names
in thread Dynamic names

The first bless \my $anon, $class; retains the name $anon for the rest of the code block - it is no longer anonymous.

The second bless {}, $class; constructs an anonymous hash, which I believe uses more memory. I cannot claim I invented the use of the do{ } construct in this way, I stole it from TheDamian.


Comment on Re^5: Dynamic names
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2014-12-28 16:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls