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.
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.
In Section
Seekers of Perl Wisdom