|We don't bite newbies here... much|
Re: Is this ancient perl or just a cargo cult?by BrowserUk (Pope)
|on Nov 01, 2013 at 05:20 UTC||Need Help??|
To me, this looks like a dodgy cargo cult way of doing an ordered hash.
It is neither dogdy; nor cargo-cult; nor do they pre-date hashes. Both became available at exactly the same time with the advent of blessed references circa. 5.001.
The constants give programmer-friendly names to the fields; whilst still allowing the field lookups to be optimally efficient.
For completeness, field lookup with a hash still requires an array lookup; but first the key (field name) has to be translated into an index number. And then, if you happen to be unlucky, there might need to be a linear search as well.
blessed arrays with named constant field indexes are a less used, but perfectly valid, highly functional and more efficient way of implementing objects in Perl.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.