diff options
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perllocale.pod | 2 | ||||
-rw-r--r-- | pod/perlop.pod | 8 | ||||
-rw-r--r-- | pod/perlre.pod | 7 |
3 files changed, 16 insertions, 1 deletions
diff --git a/pod/perllocale.pod b/pod/perllocale.pod index 4401be2053..0a85c0eb11 100644 --- a/pod/perllocale.pod +++ b/pod/perllocale.pod @@ -710,7 +710,7 @@ case-mapping with C<\l>, C<\L>,C<\u> or C<\U>. =item B<In-memory formatting function> (sprintf()): -Result is tainted if "use locale" is in effect. +Result is tainted if C<use locale> is in effect. =item B<Output formatting functions> (printf() and write()): diff --git a/pod/perlop.pod b/pod/perlop.pod index 35f9e5f4f8..8e50ec36ea 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -1149,6 +1149,7 @@ the number of characters replaced or deleted. If no string is specified via the =~ or !~ operator, the $_ string is transliterated. (The string specified with =~ must be a scalar variable, an array element, a hash element, or an assignment to one of those, i.e., an lvalue.) + A character range may be specified with a hyphen, so C<tr/A-J/0-9/> does the same replacement as C<tr/ACEGIBDFHJ/0246813579/>. For B<sed> devotees, C<y> is provided as a synonym for C<tr>. If the @@ -1156,6 +1157,13 @@ SEARCHLIST is delimited by bracketing quotes, the REPLACEMENTLIST has its own pair of quotes, which may or may not be bracketing quotes, e.g., C<tr[A-Z][a-z]> or C<tr(+\-*/)/ABCD/>. +Note also that the whole range idea is rather unportable between +character sets--and even within character sets they may cause results +you probably didn't expect. A sound principle is to use only ranges +that begin from and end at either alphabets of equal case (a-e, A-E), +or digits (0-4). Anything else is unsafe. If in doubt, spell out the +character sets in full. + Options: c Complement the SEARCHLIST. diff --git a/pod/perlre.pod b/pod/perlre.pod index 1b49ba4e7b..f696525155 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -735,6 +735,13 @@ following all specify the same class of three characters: C<[-az]>, C<[az-]>, and C<[a\-z]>. All are different from C<[a-z]>, which specifies a class containing twenty-six characters.) +Note also that the whole range idea is rather unportable between +character sets--and even within character sets they may cause results +you probably didn't expect. A sound principle is to use only ranges +that begin from and end at either alphabets of equal case ([a-e], +[A-E]), or digits ([0-9]). Anything else is unsafe. If in doubt, +spell out the character sets in full. + Characters may be specified using a metacharacter syntax much like that used in C: "\n" matches a newline, "\t" a tab, "\r" a carriage return, "\f" a form feed, etc. More generally, \I<nnn>, where I<nnn> is a string |