|
|
| We don't bite newbies here... much | |
| PerlMonks |
Re: How do you do multi-version modules?by kcott (Parson) |
| on Oct 13, 2012 at 23:30 UTC ( #998885=note: print w/ replies, xml ) | Need Help?? |
|
G'day Linda, "... when a user says: "use module 1.0.0", and I'm working in module "2.0.0"? My 2.0.0 module would never get called as far as I can tell...no?" use Module VERSION specifies a minimum version. If the user has v2.0.0 installed and their code has use Module 1.0.0;, this will work fine. "What I would want to do is have my 2.0.0 module detect if it was called by something prior to 2.0, and apply the old interface semantics for compatibility." You can add a VERSION method to your class to achieve this. This is described in use. This doco may be a little confusing: you want the use Module VERSION info (near the middle of the page); not the use VERSION info (near the top of the page). -- Ken
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||