Syntactic Confectionery Delight | |
PerlMonks |
Re: Modules as executable scripts?by aufflick (Deacon) |
on Jun 15, 2007 at 05:58 UTC ( [id://621402]=note: print w/replies, xml ) | Need Help?? |
Neat - I have a feeling I'll be doing this one day :) One suggestion for those who feel queazy about 'magic' like this is that you can easily kick off a sub in a package with something like: perl -MYour::Package -e run where run is the name of a sub that requires no args. Which approach is neater is in the eye of the beholder. I really like the comment from friedo that discussed using a similar approach to make a package that can be a standalone test script and also a base package for other tests.
In Section
Seekers of Perl Wisdom
|
|