in reply to Howto "use" backward compability packages of new "feature"s
BEGIN { if( $] < 5.012 ){ require Enumerators; Enumerators->import(); } else { require feature; feature->import(":5.12"); } }
You could use eval to use use for Enumerators, but not for a pragma.
You mentioned keys, but none of the features affect keys. In fact, the only feature you could implement as a module would be say, and there's no reason you couldn't always use your own say instead of this conditional mumbo jumbo.
Missing "0" in the version and missing ":" in the feature, btw.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Howto "use" backward compability packages of new "feature"s
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 LanX (Saint) on Aug 24, 2010 at 02:04 UTC | |
| |
by JavaFan (Canon) on Aug 25, 2010 at 09:52 UTC | |
by LanX (Saint) on Aug 25, 2010 at 11:19 UTC |