ExtUtils/Miniperl.pm not built on Win32
[p5sagit/p5-mst-13.2.git] / pod / perlfaq4.pod
index 1c1edfa..d3a7e8c 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-perlfaq4 - Data Manipulation ($Revision: 1.15 $)
+perlfaq4 - Data Manipulation ($Revision: 1.17 $, $Date: 1997/03/25 18:16:24 $)
 
 =head1 DESCRIPTION
 
@@ -254,7 +254,7 @@ Although those with a regexp kind of thought process will likely prefer
 
 You have to keep track.  For example, let's say you want
 to change the fifth occurrence of "whoever" or "whomever"
-into "whosoever", case insensitively.
+into "whosoever" or "whomsoever", case insensitively.
 
     $count = 0;
     s{((whom?)ever)}{
@@ -271,7 +271,7 @@ C<tr///> function like so:
 
     $string = "ThisXlineXhasXsomeXx'sXinXit":
     $count = ($string =~ tr/X//);
-    print "There are $count X charcters in the string";
+    print "There are $count X characters in the string";
 
 This is fine if you are just looking for a single character.  However,
 if you are trying to count multiple character substrings within a
@@ -286,12 +286,15 @@ integers:
 =head2 How do I capitalize all the words on one line?
 
 To make the first letter of each word upper case:
+
         $line =~ s/\b(\w)/\U$1/g;
 
 To make the whole line upper case:
+
         $line = uc($line);
 
 To force each word to be lower case, with the first letter upper case:
+
         $line =~ s/(\w+)/\u\L$1/g;
 
 =head2 How can I split a [character] delimited string except when inside
@@ -770,7 +773,7 @@ find one of the associated keys.   This may or may not worry you.
 If you mean how many keys, then all you have to do is
 take the scalar sense of the keys() function:
 
-       $num_keys = scalar keys %hash;
+    $num_keys = scalar keys %hash;
 
 In void context it just resets the iterator, which is faster
 for tied hashes.
@@ -897,7 +900,7 @@ they end up doing is not what they do with ordinary hashes.
 Using C<keys %hash> in a scalar context returns the number of keys in
 the hash I<and> resets the iterator associated with the hash.  You may
 need to do this if you use C<last> to exit a loop early so that when you
-re-enter it, the hash iterator has been reset.
+reenter it, the hash iterator has been reset.
 
 =head2 How can I get the unique keys from two hashes?
 
@@ -952,7 +955,7 @@ Normally, merely accessing a key's value for a nonexistent key does
 I<not> cause that key to be forever there.  This is different than
 awk's behavior.
 
-=head2 How can I make the Perl equivalent of a C structure/C++ class/hash 
+=head2 How can I make the Perl equivalent of a C structure/C++ class/hash
 or array of hashes or arrays?
 
 Use references (documented in L<perlref>).  Examples of complex data
@@ -980,7 +983,7 @@ versus "binary" files.  See L<perlfunc/"binmode">.
 
 If you're concerned about 8-bit ASCII data, then see L<perllocale>.
 
-If you want to deal with multi-byte characters, however, there are
+If you want to deal with multibyte characters, however, there are
 some gotchas.  See the section on Regular Expressions.
 
 =head2 How do I determine whether a scalar is a number/whole/integer/float?
@@ -991,7 +994,7 @@ Assuming that you don't care about IEEE notations like "NaN" or
    warn "has nondigits"        if     /\D/;
    warn "not a whole number"   unless /^\d+$/;
    warn "not an integer"       unless /^-?\d+$/;  # reject +3
-   warn "not an integer"       unless /^[+-]?\d+$/;  
+   warn "not an integer"       unless /^[+-]?\d+$/;
    warn "not a decimal number" unless /^-?\d+\.?\d*$/;  # rejects .2
    warn "not a decimal number" unless /^-?(?:\d+(?:\.\d*)?|\.\d+)$/;
    warn "not a C float"