our $VERSION = '1.00';
-$unicode8bit::hint_uni8bit = 0x00000800;
+$unicode8bit::hint_not_uni8bit = 0x00000800;
my %legacy_bundle = (
"5.10" => [qw(unicode8bit)],
=head1 NAME
-legacy - Perl pragma to preserve legacy behaviors or enable new non-default
-behaviors
+legacy - Perl pragma to preserve legacy behaviors or enable new non-default behaviors
=head1 SYNOPSIS
=head3 unicode8bit
-THIS IS SUBJECT TO CHANGE
-
Use legacy semantics for the 128 characters on ASCII systems that have the 8th
bit set. (See L</EBCDIC platforms> below for EBCDIC systems.) Unless
C<S<use locale>> is specified, or the scalar containing such a character is
This behavior stems from when Perl did not support Unicode, and ASCII was the
only known character set outside of C<S<use locale>>. In order to not
-possibly break pre_Unicode programs, these characters have retained their old
+possibly break pre-Unicode programs, these characters have retained their old
non-meanings, except when it is clear to Perl that Unicode is what is meant,
-for example by calling utf::upgrade() on a scalar, or if the scalar also
+for example by calling utf8::upgrade() on a scalar, or if the scalar also
contains characters that are only available in Unicode. Then these 128
characters take on their Unicode meanings.
=over 4
-=item
+=item *
-Changing the case of a scalar, that is, using C<uc()>,
-C<ucfirst()>,
-C<lc()>,
-and C<lcfirst()>, or C<\L>, C<\U>, C<\u> and C<\l> in regular expression substitutions.
+Changing the case of a scalar, that is, using C<uc()>, C<ucfirst()>, C<lc()>,
+and C<lcfirst()>, or C<\L>, C<\U>, C<\u> and C<\l> in regular expression
+substitutions.
-=item
+=item *
Using caseless (C</i>) regular expression matching
-=item
+=item *
Matching a number of properties in regular expressions, such as C<\w>
-=item
+=item *
User-defined case change mappings. You can create a C<ToUpper()> function, for
example, which overrides Perl's built-in case mappings. The scalar must be
Specifying sub-versions such as the C<0> in C<5.10.0> in legacy bundles has
no effect: legacy bundles are guaranteed to be the same for all sub-versions.
-Legacy bundles are not allowed with C<no legacy>
+Legacy bundles are not allowed with C<no legacy>.
=cut
if (!exists $legacy{$name}) {
unknown_legacy($name);
}
- $^H &= ~$unicode8bit::hint_uni8bit; # The only valid thing as of yet
+ $^H |= $unicode8bit::hint_not_uni8bit; # The only valid thing as of yet
}
}
unknown_legacy($name);
}
else {
- $^H |= $unicode8bit::hint_uni8bit; # The only valid thing as of yet
+ $^H &= ~ $unicode8bit::hint_not_uni8bit; # The only valid thing now
}
}
}