This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
further qualify references to "alphanumeric" (from Wolfgang Laun
authorGurusamy Sarathy <gsar@cpan.org>
Thu, 1 Jun 2000 08:24:40 +0000 (08:24 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Thu, 1 Jun 2000 08:24:40 +0000 (08:24 +0000)
<wolfgang.laun@alcatel.at>)

p4raw-id: //depot/perl@6186

handy.h
pod/perlapi.pod
pod/perldata.pod
pod/perlfaq6.pod
pod/perlfaq9.pod
pod/perllocale.pod
pod/perlre.pod

diff --git a/handy.h b/handy.h
index 81f4745..de0fa57 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -261,7 +261,7 @@ C<strncmp>).
 /*
 =for apidoc Am|bool|isALNUM|char ch
 Returns a boolean indicating whether the C C<char> is an ASCII alphanumeric
-character or digit.
+character (including underscore) or digit.
 
 =for apidoc Am|bool|isALPHA|char ch
 Returns a boolean indicating whether the C C<char> is an ASCII alphabetic
index cd467ba..2532620 100644 (file)
@@ -670,7 +670,7 @@ Undefines the hash.
 =item isALNUM
 
 Returns a boolean indicating whether the C C<char> is an ASCII alphanumeric
-character or digit.
+character (including underscore) or digit.
 
        bool    isALNUM(char ch)
 
index ac444fa..a2bb840 100644 (file)
@@ -303,7 +303,8 @@ price is $Z<>100."
     print "The price is $Price.\n";    # interpreted
 
 As in some shells, you can enclose the variable name in braces to
-disambiguate it from following alphanumerics.  You must also do
+disambiguate it from following alphanumerics (and underscores).
+You must also do
 this when interpolating a variable into a string to separate the
 variable name from a following double-colon or an apostrophe, since
 these would be otherwise treated as a package separator:
index bf007ee..29136ab 100644 (file)
@@ -415,7 +415,8 @@ Use the split function:
 Note that this isn't really a word in the English sense; it's just
 chunks of consecutive non-whitespace characters.
 
-To work with only alphanumeric sequences, you might consider
+To work with only alphanumeric sequences (including underscores), you
+might consider
 
     while (<>) {
        foreach $word (m/(\w+)/g) {
index 16a803c..d1bd593 100644 (file)
@@ -215,7 +215,8 @@ Here's an example of decoding:
     $string =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge;
 
 Encoding is a bit harder, because you can't just blindly change
-all the non-alphanumunder character (C<\W>) into their hex escapes.
+all characters that are not letters, digits or underscores (C<\W>)
+into their hex escapes.
 It's important that characters with special meaning like C</> and C<?>
 I<not> be translated.  Probably the easiest way to get this right is
 to avoid reinventing the wheel and just use the URI::Escape module,
index 55ccf44..ddb5a6e 100644 (file)
@@ -449,7 +449,7 @@ if you "use locale".
        a A b B c C d D e E
        a b c d e A B C D E
 
-Here is a code snippet to tell what alphanumeric
+Here is a code snippet to tell what "word"
 characters are in the current locale, in that locale's order:
 
         use locale;
@@ -518,8 +518,9 @@ results, and so always obey the current C<LC_COLLATE> locale.
 In the scope of S<C<use locale>>, Perl obeys the C<LC_CTYPE> locale
 setting.  This controls the application's notion of which characters are
 alphabetic.  This affects Perl's C<\w> regular expression metanotation,
-which stands for alphanumeric characters--that is, alphabetic and
-numeric characters.  (Consult L<perlre> for more information about
+which stands for alphanumeric characters--that is, alphabetic,
+numeric, and including other special characters such as the underscore or
+hyphen.  (Consult L<perlre> for more information about
 regular expressions.)  Thanks to C<LC_CTYPE>, depending on your locale
 setting, characters like 'E<aelig>', 'E<eth>', 'E<szlig>', and
 'E<oslash>' may be understood as C<\w> characters.
index a82ab32..15e58c1 100644 (file)
@@ -254,15 +254,15 @@ backspace are control characters.  All characters with ord() less than
 
 =item graph
 
-Any alphanumeric or punctuation character.
+Any alphanumeric or punctuation (special) character.
 
 =item print
 
-Any alphanumeric or punctuation character or space.
+Any alphanumeric or punctuation (special) character or space.
 
 =item punct
 
-Any punctuation character.
+Any punctuation (special) character.
 
 =item xdigit
 
@@ -381,6 +381,7 @@ use for a pattern. Simply quote all non-"word" characters:
 
     $pattern =~ s/(\W)/\\$1/g;
 
+(If C<use locale> is set, then this depends on the current locale.)
 Today it is more common to use the quotemeta() function or the C<\Q>
 metaquoting escape sequence to disable all metacharacters' special
 meanings like this: