Commit | Line | Data |
---|---|---|
657b208b | 1 | package bytes; |
5bc28da9 | 2 | |
d5448623 | 3 | $bytes::hint_bits = 0x00000008; |
4 | ||
5bc28da9 | 5 | sub import { |
d5448623 | 6 | $^H |= $bytes::hint_bits; |
5bc28da9 | 7 | } |
8 | ||
9 | sub unimport { | |
d5448623 | 10 | $^H &= ~$bytes::hint_bits; |
5bc28da9 | 11 | } |
12 | ||
13 | sub AUTOLOAD { | |
657b208b | 14 | require "bytes_heavy.pl"; |
5bc28da9 | 15 | goto &$AUTOLOAD; |
16 | } | |
17 | ||
18 | sub length ($); | |
19 | ||
20 | 1; | |
21 | __END__ | |
22 | ||
23 | =head1 NAME | |
24 | ||
657b208b | 25 | bytes - Perl pragma to force byte semantics rather than character semantics |
5bc28da9 | 26 | |
27 | =head1 SYNOPSIS | |
28 | ||
657b208b | 29 | use bytes; |
30 | no bytes; | |
5bc28da9 | 31 | |
32 | =head1 DESCRIPTION | |
33 | ||
393fec97 | 34 | WARNING: The implementation of Unicode support in Perl is incomplete. |
21bad921 | 35 | See L<perlunicode> for the exact details. |
393fec97 | 36 | |
657b208b | 37 | The C<use bytes> pragma disables character semantics for the rest of the |
38 | lexical scope in which it appears. C<no bytes> can be used to reverse | |
39 | the effect of C<use bytes> within the current lexical scope. | |
393fec97 | 40 | |
41 | Perl normally assumes character semantics in the presence of | |
42 | character data (i.e. data that has come from a source that has | |
3969a896 | 43 | been marked as being of a particular character encoding). |
393fec97 | 44 | |
45 | To understand the implications and differences between character | |
46 | semantics and byte semantics, see L<perlunicode>. | |
47 | ||
48 | =head1 SEE ALSO | |
49 | ||
50 | L<perlunicode>, L<utf8> | |
5bc28da9 | 51 | |
52 | =cut |