P is for Practical | |
PerlMonks |
Re^4: Finding version of a Perl moduleby ikegami (Patriarch) |
on Sep 09, 2005 at 15:23 UTC ( [id://490603]=note: print w/replies, xml ) | Need Help?? |
Yes, but you need something to call UNIVERSAL::VERSION. Usually, that something is Exporter. Proof:
Notice how the version passed to Module1 is completely ignored. In writing this test, I also found errors in what I thought I knew. 1) *import = \&Exporter::import; doesn't work as well as I thought. My original Module2 gave a run-time error. It was:
To fix without inheriting from Exporter, one needs to also import require_version:
2) I always thought use Module 'maj.min' would make sure the major version is the same as the one in $VERSION, yet use Module2 '1.0' doesn't fail.
In Section
Seekers of Perl Wisdom
|
|