|
Posted by dummy on May 13, 2008, 5:13 am
Please log in for more thread options
> _
>dummy@phony.info (dummy@phony.info) wrote on VCCCLXVII September MCMXCIII
><> I understand that one can specify that a script must be run under a perl
><> version no earlier than a particular version. So, if I say 'use 5.6.0',
><> that code will throw an error if one tries to run it under perl 5.5.0,
><> right?
><>
><> But how about the reverse case?
>
>The reverse case is pretty easy:
>
> BEGIN {
> die "Your Perl version is too new" if $] > 5.008008;
> }
Not what I meant. That would prevent me from doing the development on
the desktop, using 5.10.0, defeating my intent.
BTW, beginning with 5.10.0 one can say "no someversion", which might
someday be of some use, but not now. It throws an error in 5.10.0,
since 5.10.0 is too new, and it throws an error in every other version
too, since it's not recognized. One could say "no 5.10.2", and that
would throw an error if someday 5.10.2 were installed, forcing you to
delete the "no 5.10.2". But what good could that possibly be?
>
><> Suppose I write code on my desktop, which has perl 5.10.0 installed, and
><> later transfer that code to a system that only has perl as far as 5.8.8.
><> How can I cause an error on the desktop if I accidentally use any of the
><> new features of 5.10.0, as I would want to do to signal incompatibility?
>
>That's not the reverse case.
You are right, sorry.
>
><> Is this sort of thing impossible?
>
>
>Basically, yes. There are some new features that aren't available unless
>turned on explicitely, but that isn't the case for features that will not
>cause any backwards compatability issues. For instance, there are a ton of
>new features when using regexpes, and you get them regardless whether you
>use "use feature" or not. Furthermore, bug fixes will be there as well, and
>so will any modules that are in 5.010, but not in an older install of Perl.
>
>The best way to avoid accidentily using features that aren't available on
>older Perl is to install the oldest Perl you want to develop for, and test
>with that.
I was afraid of that. I sure don't want to go back to Active State, and
strawberry is not available with older versions.
|