Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: help with versioning modules

by NetWallah (Canon)
on Nov 20, 2020 at 21:12 UTC ( [id://11123937]=note: print w/replies, xml ) Need Help??


in reply to help with versioning modules

For your issue with "Numbered version directories", I was able to get it to "work" by :

* mkdir My/1.2
* Move Foo.pm to My/1.2/
* Change the internal $VERSION to 1.2
* change the "use" declarations in foo_version_test.pl to:

use lib 'My/1.2'; use Foo 1.2;
Notice that the folder name goes into the "use lib", and avoids issues with bareword requirements for the module name.

                "Imaginary friends are a sign of a mental disorder if they cause distress, including antisocial behavior. Religion frequently meets that description"

Replies are listed 'Best First'.
Re^2: help with versioning modules
by choroba (Cardinal) on Nov 20, 2020 at 22:25 UTC
    Also, to prevent duplication, note that both the path in "use lib" and the module version in "use Foo" can contain variables, but you need to populate them in the compile time.
    my $required_version; BEGIN { $required_version = '1.2'; } use lib "My/$required_version"; use Foo $required_version;
    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^2: help with versioning modules
by Special_K (Monk) on Nov 23, 2020 at 01:27 UTC

    Thanks, that should probably work for my case.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11123937]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-19 02:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found