- # hack to check that the hint hash hasn't changed
- if ($] > 5.009 &&
- "@{[sort %{$self->{'hinthash'} || {}}]}"
- ne "@{[sort %{$op->hints_hash->HASH || {}}]}") {
- push @text, declare_hinthash($self->{'hinthash'}, $op->hints_hash->HASH, $self->{indent_size});
- $self->{'hinthash'} = $op->hints_hash->HASH;
+ my $newhh;
+ if ($] > 5.009) {
+ $newhh = $op->hints_hash->HASH;
+ }
+
+ if ($] >= 5.015006) {
+ # feature bundle hints
+ my $from = $old_hints & $feature::hint_mask;
+ my $to = $ hints & $feature::hint_mask;
+ if ($from != $to) {
+ if ($to == $feature::hint_mask) {
+ if ($self->{'hinthash'}) {
+ delete $self->{'hinthash'}{$_}
+ for grep /^feature_/, keys %{$self->{'hinthash'}};
+ }
+ else { $self->{'hinthash'} = {} }
+ $self->{'hinthash'}
+ = _features_from_bundle($from, $self->{'hinthash'});
+ }
+ else {
+ my $bundle =
+ $feature::hint_bundles[$to >> $feature::hint_shift];
+ $bundle =~ s/(\d[13579])\z/$1+1/e; # 5.11 => 5.12
+ push @text, "no feature;\n",
+ "use feature ':$bundle';\n";
+ }
+ }
+ }
+
+ if ($] > 5.009) {
+ push @text, declare_hinthash(
+ $self->{'hinthash'}, $newhh,
+ $self->{indent_size}, $self->{hints},
+ );
+ $self->{'hinthash'} = $newhh;