<div dir="ltr">ok - i'm now officially a maintainer on <a href="http://only.pm">only.pm</a> - it just so happens ingy wants to start giving it some love.<div><br></div><div>so, if you want to try it out, and you have issues, it *is* now going to be getting some attention.</div>
<div><br></div><div>/bda</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 9, 2014 at 3:00 PM, Mark Senn <span dir="ltr"><<a href="mailto:mark@ecn.purdue.edu" target="_blank">mark@ecn.purdue.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">>  In Javascript, when I include a library I wrote, I put <script<br>
>  src="bulldada_0.1.js"> and if I want to work on the module and make<br>
>  changes, I can do that to bulldada_0.2.js, and I can change the HTML<br>
>  when and if I'm ready to use 0.2. Theoretically, I can have a directory<br>
>  full of bulldada_*.*.js.<br>
><br>
>  The capabilities are almost there with Perl. I can specify a version in my<br>
>  module:<br>
>      package Bull::Dada ;<br>
>      our $VERSION = 0.01 ;<br>
>      1<br>
><br>
>  I can specify a version number in my code;<br>
>      use strict ;<br>
>      use lib '/home/jacoby/lib' ;<br>
>      use Bull::Dada 0.01 ;<br>
><br>
>  But, Bull::Dada, as I understand it, has to be<br>
>  /home/jacoby/lib/Bull/Dada.pm. I couldn't have it be<br>
</div>>  /home/jacoby/lib/Bull/ <a href="http://Dada_0.01.pm" target="_blank">Dada_0.01.pm</a> alongside <a href="http://Dada_0.02.pm" target="_blank">Dada_0.02.pm</a>, where I'm<br>
<div class="">>  changing the subroutines around and such, but I'm not ready to use it in<br>
>  real code, or perhaps it uses OAuth 2.0 while 0.01 uses OAuth 1.0 or<br>
>  whatever.<br>
><br>
>  To my knowledge, I cannot do this in Perl, as much as I may desire it. Am I<br>
>  wrong?<br>
<br>
</div>You can do it just like with the .js files.  Just name them differently,<br>
say, Dada001.pm and Dada002.pm.  As far as I know there is nothing in the<br>
Perl 5.20 core that will do what you want where a module name and version<br>
number map to a unique file name.<br>
<br>
Or, do something like this, here is the <a href="http://t.pl" target="_blank">t.pl</a> file:<br>
<br>
    #!/usr/new/bin/perl<br>
    #<br>
    #  /usr/new/bin/perl --version<br>
    #  prints<br>
    #  This is perl 5, version 20, subversion 0 (v5.20.0)<br>
    #  built for x86_64-linux-thread-multi<br>
    #<br>
<br>
    use Modern::Perl;<br>
<br>
    # Use one of the following two lines.<br>
    # I link this because it it's pretty staightforward and<br>
    # isn't too much action at a distance.<br>
    use lib qw(./Testing ./Production ./NeededForBoth);<br>
    # use lib qw(./Production ./Testing ./NeededForBoth);<br>
<br>
    use MyPackage;<br>
    PrintWhich;<br>
<br>
Here is Testing/MyPackage.pm:<br>
<br>
    # ./Testing/MyPackage.pm<br>
<br>
    package MyPackage;<br>
<br>
    use feature 'say';<br>
<br>
    use Exporter;<br>
<br>
    our @ISA         = qw/Exporter/;<br>
    our @EXPORT      = qw/&PrintWhich/;<br>
    our @EXPORT_OK   = qw//;<br>
    our %EXPORT_TAGS = ();<br>
    our $VERSION     = 0.02;<br>
<br>
    sub PrintWhich<br>
    {<br>
        say 'Testing';<br>
    }<br>
<br>
    1<br>
<br>
And here is Production/MyPackage.pm<br>
<br>
    # ./Production/MyPackage.pm<br>
<br>
    package MyPackage;<br>
<br>
    use feature 'say';<br>
<br>
    use Exporter;<br>
<br>
    our @ISA         = qw/Exporter/;<br>
    our @EXPORT      = qw/&PrintWhich/;<br>
    our @EXPORT_OK   = qw//;<br>
    our %EXPORT_TAGS = ();<br>
    our $VERSION     = 0.01;<br>
<br>
    sub PrintWhich<br>
    {<br>
        say 'Production';<br>
    }<br>
<br>
    1<br>
<br>
Or, you could invoke the packages with names in an index that<br>
get take the module name and the version number and map that<br>
into a filename.  I wouldn't do that though, just another thing<br>
to worry about.  For me it is easier to think about Perl<br>
modules if they exist in one directory will be used before<br>
any that exist in other directories.<br>
<span class="HOEnZb"><font color="#888888"><br>
-mark<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Purdue-pm mailing list<br>
<a href="mailto:Purdue-pm@pm.org">Purdue-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/purdue-pm" target="_blank">http://mail.pm.org/mailman/listinfo/purdue-pm</a><br>
</div></div></blockquote></div><br></div>