![]() |
|
"be consistent" | |
PerlMonks |
Hiding the Module 'Path'by dvergin (Monsignor) |
on Jan 26, 2002 at 08:03 UTC ( #141723=perlquestion: print w/replies, xml ) | Need Help?? |
dvergin has asked for the wisdom of the Perl Monks concerning the following question:
Here's one that caused me to sit back and go, "Hmmmm...".
Reading through some well-distributed code I found this near the top of the main script: Now, although I have never seen the little meme in that BEGIN block before, I understand what it is doing. (That's not the question.) My question is this: "is this a Good Practice?" What is the point? So far as I can see, this bit of source-hiding simply saves a few keystrokes near the top of the file. And if done to access it could lead to some maintainance annoyances. Imagine adding several module paths to @INC and then trying to find the modules later: "Let's see, I wonder if the module referred to in 'use Parser' is XML::Parser or HTML::Parser..." It's cute. It's slick. But is it Good? David Update: Thanks to the responders below for confirming my misgivings. I'm open to learn new approaches, but this one felt wrong from the get-go.
Back to
Seekers of Perl Wisdom
|
|