|
|
| No such thing as a small change | |
| PerlMonks |
Re: How do you do multi-version modules?by ikegami (Pope) |
| on Oct 13, 2012 at 23:53 UTC ( #998887=note: print w/ replies, xml ) | Need Help?? |
|
Polymorphic API: If this is an OO-based module, you could pass a protocol version to the constructor. (Kinda like many file formats include a version.) If it's not, you could write your own import sub and use use module "1.0.0"; instead of use module 1.0.0;. This would be a bit error prone. Parallel APIs: The other approach is add to the interface instead of replacing it. You can use two different module names: "module" for 1.x.x and "module2" for 2.x.x, or you can add methods instead of replacing old ones (do_something2 is the new interface for do_someting).
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||