On Sat Jan 07 01:15:59 2012, ANDK wrote:
Show quoted text> As per subject.
>
> CC'd to Father Chrysostoms who implements the new feature semantics with
> a plea for a comment.
uni::perl is enabling features by setting hints itself, instead of loading feature.pm. So it is
making assumptions about another module’s hints.
Of course, the easiest way to fix it is to use feature->import.
If you want to avoid loading feature.pm, it gets complicated.
To avoid loading feature.pm itself, and for speed in checking the hints, the perl core now
uses hints in $^H to indicate the selected feature bundle.
$^H & 0x1c000000 will hive you the feature bundle number.
The values are currently ((%^H & 0x1c000000) >> 26):
0 - array_base
1 - array_base say state switch
2 - array_base say state switch unicode_strings
3 - current_sub evalbytes say state switch unicode_eval unicode_srings
7 - indicated by %^H
That last case is ($^H & 0x1c000000) == 0x1c000000.
So if you just want to enable say, state and switch, leaving the setting of every other feature
as it was (which is what your module currently does), you have to check the existing feature
bundle number.
If it is 0 (or 1), you can just set it to 1.
If it is anything else, you have to set it to 7, turn off all %^H feature hints, turn on all %^H
hints that were already enabled implicitly via $^H, and then enable say, switch and state via
%^H as you do currently.
You have to turn off existing feature hints in %^H, because this code:
use feature "evalbytes";
use 5.010;
will leave feature_evalbytes in %^H when ‘use 5.010’ sets the bundle number to 1 (for speed’s
sake).
It might be best to set the feature bundle number to 1 if it is 0 or 1, and fall back to feature-
Show quoted text>import otherwise.