in reply to Re: Perl Best Practices for naming variables
in thread Perl Best Practices for naming variables
A point of clarification... this fails at compile-time:
$comments_ref[0] = 'foo'; # 2
... while this fails at runtime (assuming that $comments doesn't contain a ref, as implied by the lack of HungDamian suffix):
$comments->[0] = 'foo'; # 3
I hadn't addressed the situation where a spurious dereferencing operator causes problems, but yes, now that I think about it, I've done that every once in a while. Depending on how rarely the code branch containing the bogus arrow gets accessed, that might produce an unpleasant surprise at an inopportune moment.
Fortunately, thanks to Data::Alias, I can have my spinach and eat it too. I'm persuaded. I'll start using _ref.
But those hash names are going to stay plural for now.
Cheers,
--
Marvin Humphrey
Rectangular Research
http://www.rectangular.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl Best Practices for naming variables
by Tanktalus (Canon) on Aug 07, 2005 at 14:18 UTC | |
by ff (Hermit) on Dec 20, 2006 at 12:03 UTC |