This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Minor perlfaq5 tweaks
authorFather Chrysostomos <sprout@cpan.org>
Sat, 19 Feb 2011 14:15:04 +0000 (06:15 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 19 Feb 2011 15:08:18 +0000 (07:08 -0800)
pod/perlfaq5.pod

index 1866a03..e0f9da4 100644 (file)
@@ -494,8 +494,8 @@ Berkeley-style ps:
        }
 
 We've used a hash slice in order to easily handle the fields of each row.
-Storing the keys in an array means it's easy to operate on them as a
-group or loop over them with for. It also avoids polluting the program
+Storing the keys in an array makes it easy to operate on them as a
+group or loop over them with C<for>. It also avoids polluting the program
 with global variables and using symbolic references.
 
 =head2 How can I make a filehandle local to a subroutine?  How do I pass filehandles between subroutines?  How do I make an array of filehandles?
@@ -542,7 +542,7 @@ check out the Symbol or IO::Handle modules.
 =head2 How can I use a filehandle indirectly?
 X<filehandle, indirect>
 
-An indirect filehandle is using something other than a symbol
+An indirect filehandle is the use of something other than a symbol
 in a place that a filehandle is expected. Here are ways
 to get indirect filehandles:
 
@@ -553,8 +553,7 @@ to get indirect filehandles:
        $fh =  *SOME_FH{IO};   # blessed IO::Handle from *SOME_FH typeglob
 
 Or, you can use the C<new> method from one of the IO::* modules to
-create an anonymous filehandle, store that in a scalar variable,
-and use it as though it were a normal filehandle.
+create an anonymous filehandle and store that in a scalar variable.
 
        use IO::Handle;                     # 5.004 or higher
        my $fh = IO::Handle->new();
@@ -843,7 +842,7 @@ be an atomic operation over NFS. That is, two processes might both
 successfully create or unlink the same file! Therefore O_EXCL
 isn't as exclusive as you might wish.
 
-See also the new L<perlopentut>.
+See also L<perlopentut>.
 
 =head2 Why do I sometimes get an "Argument list too long" when I use E<lt>*E<gt>?
 X<argument list too long>
@@ -873,13 +872,13 @@ X<filename, special characters>
 
 (contributed by Brian McCauley)
 
-The special two argument form of Perl's open() function ignores
+The special two-argument form of Perl's open() function ignores
 trailing blanks in filenames and infers the mode from certain leading
 characters (or a trailing "|"). In older versions of Perl this was the
 only version of open() and so it is prevalent in old code and books.
 
-Unless you have a particular reason to use the two argument form you
-should use the three argument form of open() which does not treat any
+Unless you have a particular reason to use the two-argument form you
+should use the three-argument form of open() which does not treat any
 characters in the filename as special.
 
        open my $fh, "<", "  file  ";  # filename is "   file   "
@@ -998,7 +997,7 @@ X<append> X<file, append>
 If you are on a system that correctly implements C<flock> and you use
 the example appending code from "perldoc -f flock" everything will be
 OK even if the OS you are on doesn't implement append mode correctly
-(if such a system exists.) So if you are happy to restrict yourself to
+(if such a system exists). So if you are happy to restrict yourself to
 OSs that implement C<flock> (and that's not really much of a
 restriction) then that is what you should do.
 
@@ -1017,7 +1016,7 @@ C<syswrite> function which is simply a wrapper around your system's
 C<write(2)> system call.
 
 There is still a small theoretical chance that a signal will interrupt
-the system level C<write()> operation before completion. There is also
+the system-level C<write()> operation before completion. There is also
 a possibility that some STDIO implementations may call multiple system
 level C<write()>s even if the buffer was empty to start. There may be
 some systems where this probability is reduced to zero, and this is
@@ -1160,7 +1159,7 @@ You should think long and hard about why you need everything loaded at
 once. It's just not a scalable solution. You might also find it more
 fun to use the standard C<Tie::File> module, or the C<DB_File> module's
 C<$DB_RECNO> bindings, which allow you to tie an array to a file so that
-accessing an element the array actually accesses the corresponding
+accessing an element of the array actually accesses the corresponding
 line in the file.
 
 You can read the entire filehandle contents into a scalar.
@@ -1281,7 +1280,7 @@ not POSIX, not Unix, etc.) systems.
 
 You should also check out the Frequently Asked Questions list in
 comp.unix.* for things like this: the answer is essentially the same.
-It's very system dependent. Here's one solution that works on BSD
+It's very system-dependent. Here's one solution that works on BSD
 systems:
 
        sub key_ready {
@@ -1320,7 +1319,7 @@ Or write a small C program using the editor of champions:
        % ./fionread
        0x4004667f
 
-And then hard code it, leaving porting as an exercise to your successor.
+And then hard-code it, leaving porting as an exercise to your successor.
 
        $FIONREAD = 0x4004667f;         # XXX: opsys dependent
 
@@ -1373,7 +1372,7 @@ Or even with a literal numeric descriptor:
        my $fd = $ENV{MHCONTEXTFD};
        open $mhcontext, "<&=$fd";  # like fdopen(3S)
 
-Note that "<&STDIN" makes a copy, but "<&=STDIN" make
+Note that "<&STDIN" makes a copy, but "<&=STDIN" makes
 an alias. That means if you close an aliased handle, all
 aliases become inaccessible. This is not true with
 a copied one.