Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: How do you do multi-version modules?

by kcott (Chancellor)
on Oct 13, 2012 at 23:30 UTC ( #998885=note: print w/replies, xml ) Need Help??

in reply to How do you do multi-version modules?

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"

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

Replies are listed 'Best First'.
Re^2: How do you do multi-version modules?
by perl-diddler (Hermit) on Oct 14, 2012 at 01:15 UTC
    Thanks for the tip...I think in all the other stuff about use, I missed that section... Will have to go study it again...(so many places are like that -- especially when functions get updated...)... Yup, that sounds about perfect... didn't realize version was an overridable universal method...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998885]
NodeReaper edits tomorrow's obituaries

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2018-05-21 15:22 GMT
Find Nodes?
    Voting Booth?