Welcome to the Monastery | |
PerlMonks |
Re^3: Constant names come into conflict with Perl style?by reyjrar (Hermit) |
on Feb 07, 2007 at 20:20 UTC ( [id://598872]=note: print w/replies, xml ) | Need Help?? |
constant.pm actually is creating subroutines. I picked up a copy of Perl Best Practices, in which Damian Conway recommends Readonly.pm for the exact reasont that you stated. I'm not sure what you're looking for here. The "best practices" are constantly evolving as new and interesting modules enter the fray. Program the way that makes sense to you. Following best practices is encouraged but not required and not always the best solution. Typically uppercase subroutines signify that they'll be called by some internals. This isn't set in stone as heredocs and labels typcially use all caps as well. Generally you need to establish context to determine how in accordance with best practice a particular piece of code is. It makes sense for a constant to be a variable, which is why I like Readonly. I have run into issues where a Readonly array is actually useful. It doesn't happen daily, but when it does rear it's head, I like to address it with Readonly.pm rather than some copying hack. If you want to get into the philosophy of when and where to hold down shift, perhaps starting a thread on Meditations would be a better fit.
-brad..
In Section
Seekers of Perl Wisdom
|
|