"be consistent" | |
PerlMonks |
Package vs. plain fileby bradcathey (Prior) |
on Jun 04, 2005 at 16:20 UTC ( [id://463539]=perlquestion: print w/replies, xml ) | Need Help?? |
bradcathey has asked for the wisdom of the Perl Monks concerning the following question: Fellow Monasterians, I'm discovering the benefits of reusable code. My question is this: do I have to put the code in a package or can it just be a file that ends with 1;? I have done it both ways, but the package method requires a little extra code. I have read in Programming Perl that the package method protects the namespaces, but what else? Thanks. Main (without using package):
Common.pm:
Main (with package):
Common.pm:
—Brad "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Back to
Seekers of Perl Wisdom
|
|