laziness, impatience, and hubris | |
PerlMonks |
Re^3: Smartmatch alternativesby tobyink (Canon) |
on Dec 17, 2013 at 19:13 UTC ( [id://1067512]=note: print w/replies, xml ) | Need Help?? |
It makes sense to use hash keys if all the items being searched through are strings. If some of them are regexps, coderefs, objects with overloading, etc., then a hash is not an option.
use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|