LanX has asked for the wisdom of the Perl Monks concerning the following question:
I really like these new applications of keys, values and each on arrays.
Re: why doesn't "my ($a,$b)" return a list?
But I'm often coding for older Perl versions.
It shouldn't be to complicated to override CORE:each and the others.
BUT I'm not sure how to import such a module ONLY if these features are not already available.
I think I could hack something with BEGIN{} and require, but hopefully there is already a best practice receipt for this?
if( $] < 5.12 ){ use Enumerators; } else { use feature "5.12"; }
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Howto "use" backward compability packages of new "feature"s
by ikegami (Patriarch) on Aug 20, 2010 at 13:36 UTC | |
by LanX (Saint) on Aug 20, 2010 at 21:25 UTC | |
by ikegami (Patriarch) on Aug 20, 2010 at 22:53 UTC | |
by LanX (Saint) on Aug 23, 2010 at 14:40 UTC | |
by ikegami (Patriarch) on Aug 23, 2010 at 23:46 UTC | |
| |
by JavaFan (Canon) on Aug 25, 2010 at 09:52 UTC | |
|