in reply to How do you do multi-version modules?
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).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do you do multi-version modules?
by pokki (Monk) on Oct 13, 2012 at 23:59 UTC | |
|
Re^2: How do you do multi-version modules?
by perl-diddler (Chaplain) on Oct 14, 2012 at 01:14 UTC |