No such thing as a small change | |
PerlMonks |
Testing for valid package namesby boftx (Deacon) |
on Nov 25, 2013 at 20:51 UTC ( [id://1064292]=perlquestion: print w/replies, xml ) | Need Help?? |
boftx has asked for the wisdom of the Perl Monks concerning the following question: I have a need to test a string to see if it would be a valid name for a package suitable for submission to CPAN. Currently, I am taking a rather draconic approach and allowing only the characters that are matched by \w. My questions are these:
Here is the test code:
Update: Added foo.pm to list of bad names. Update 2: Questions 1 and 2 are answered directly by the code from Module::Runtime supplied below by tobyink
It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.
Back to
Seekers of Perl Wisdom
|
|