summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-08-12 18:42:35 +0300
committerGurusamy Sarathy <gsar@cpan.org>1998-09-23 03:20:13 +0000
commit8ada0baa1f731edbe470a7630cfeb30c131b4672 (patch)
tree878d7ca51320e5fb9ab9f95b0c13c54031deddad /pod
parent4beedc23b598a493399ba23c8c4bd5448e52283a (diff)
downloadperl-8ada0baa1f731edbe470a7630cfeb30c131b4672.tar.gz
apply minimal variant of patch (sent via private mail)
Message-Id: <199808121242.PAA29761@comanche.spices> Subject: [PATCH] 5.004_02 or 5.005_51: fix regexp and tr character ranges in non-ASCII lands p4raw-id: //depot/perl@1803
Diffstat (limited to 'pod')
-rw-r--r--pod/perllocale.pod2
-rw-r--r--pod/perlop.pod8
-rw-r--r--pod/perlre.pod7
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