$self->{'hints'} = $hints;
}
- # 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});
+ @text != push @text, declare_hinthash(
+ $self->{'hinthash'}, $op->hints_hash->HASH,
+ $self->{indent_size}
+ )
+ ) {
$self->{'hinthash'} = $op->hints_hash->HASH;
}
push @decls, qq(delete \$^H{'$key'};);
}
}
- @decls or return '';
+ @decls or return;
return join("\n" . (" " x $indent), "BEGIN {", @decls) . "\n}\n";
}
}
BEGIN { $^H{q[']} = '('; }
print $_;
+####
+# hint hash changes that serialise the same way with sort %hh
+BEGIN { $^H{'a'} = 'b'; }
+{
+ BEGIN { $^H{'b'} = 'a'; delete $^H{'a'}; }
+ print $_;
+}
+print $_;