Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: module versions

3 views
Skip to first unread message

Octavian Rasnita

unread,
May 15, 2013, 3:28:07 PM5/15/13
to shawn wilson, begi...@perl.org
From: "shawn wilson" <ag4v...@gmail.com>


>I asked this in #perl-help and was told that by the time perl checked
> the version, the module was already loaded - is there a way to check
> the version without completely loading the module so that when one
> failed, I could move on to another module of the same name whose
> version might succeed?
>
> I attached a tar file with a test, let me know if nothing is seen.
>


--------------------------------------------------------------------------------


> --



This check is usually done at development time.
Is there a reason you can't check which version of the modules you need are
working with your code when you create the app?

Octavian

shawn wilson

unread,
May 15, 2013, 3:55:25 PM5/15/13
to Octavian Rasnita, begi...@perl.org
On Wed, May 15, 2013 at 3:28 PM, Octavian Rasnita <oras...@gmail.com> wrote:
> From: "shawn wilson" <ag4v...@gmail.com>
>
>
>
>> I asked this in #perl-help and was told that by the time perl checked
>> the version, the module was already loaded - is there a way to check
>> the version without completely loading the module so that when one
>> failed, I could move on to another module of the same name whose
>> version might succeed?
>>
>> I attached a tar file with a test, let me know if nothing is seen.
>>
>

>
> This check is usually done at development time.
> Is there a reason you can't check which version of the modules you need are
> working with your code when you create the app?
>

No, I suppose i can just do perl -Ilib for development and the like.
However, not checking that there is a satisfactory module version
anywhere along the namespace seems to make things more brittle than
they nead to be (and it's annoying me :) ).

Peter Eztta

unread,
May 15, 2013, 4:00:23 PM5/15/13
to begi...@perl.org
How about using ExtUtils::MakeMaker or Module::Build and checking for the required version at build time?

I suppose this doesn't address the desire to use a different version if the one you're looking for isn't present though...

Regards,

Peter H. Ezetta
> --
> To unsubscribe, e-mail: beginners-...@perl.org
> For additional commands, e-mail: beginne...@perl.org
> http://learn.perl.org/
>
>

Confidentiality Notice: This e-mail may contain proprietary information some of which may be legally privileged. It is for the intended recipient(s) only. If you believe that it has been sent to you in error, please notify the sender by reply e-mail and delete the message. Any disclosure, copying, distribution or use of this information by someone other than the intended recipient(s) is prohibited and may be unlawful.

shawn wilson

unread,
May 15, 2013, 4:47:18 PM5/15/13
to Ron Bergin, begi...@perl.org
On Wed, May 15, 2013 at 4:13 PM, Ron Bergin <r...@i.frys.com> wrote:
> shawn wilson wrote:
>> I asked this in #perl-help and was told that by the time perl checked
>> the version, the module was already loaded - is there a way to check
>> the version without completely loading the module so that when one
>> failed, I could move on to another module of the same name whose
>> version might succeed?
>>
>
> Why not specify the minimum version number that your script requires in
> the use statement? If that version is not available, then what's the
> point of going forward?
>

See my test case - I do have a minimum version. The point in going
forward is that the minimum version IS met further along the path.

> If you don't want to do that, then you could use Module::Load::Conditional
> to test if the desired version is loadable.
>
> http://search.cpan.org/~bingos/Module-Load-Conditional-0.54/lib/Module/Load/Conditional.pm
>

That module might work if I manually cycle through single paths in
@INC and test. Though I'm not sure about the side effects of doing
this might be?
0 new messages