use utf8 has the following effects: bytes with their high-bit set (identifiers, string constants, constant regular expressions, package names) will be treated as literal UTF-8 characters and regular expressions within the scope of the utf8 pragma and will default to using character semantics instead of byte semantics. For example:
@bytes_or_chars = split //, $data; # May split to bytes if data # $data isn't UTF-8 { use utf8; # Forces char semantics @chars = split //, $data; # Splits characters }
Copyright © 2002 O'Reilly & Associates. All rights reserved.