This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update perlfaq to version 5.015046
authorKaren Etheridge <ether@cpan.org>
Sun, 19 Oct 2014 02:12:09 +0000 (19:12 -0700)
committerJames E Keenan <jkeenan@cpan.org>
Sun, 19 Oct 2014 12:16:57 +0000 (08:16 -0400)
cpan/perlfaq/lib/perlfaq.pm
cpan/perlfaq/lib/perlfaq2.pod
cpan/perlfaq/lib/perlfaq4.pod
cpan/perlfaq/lib/perlfaq5.pod
cpan/perlfaq/lib/perlfaq6.pod

index 9a64d66..e39ba5d 100644 (file)
@@ -1,3 +1,5 @@
+use strict;
+use warnings;
 package perlfaq;
-$perlfaq::VERSION = '5.0150045';
-0; # not is it supposed to be loaded
+$perlfaq::VERSION = '5.0150046';
+1;
index ce7cd1b..4f0a413 100644 (file)
@@ -174,7 +174,7 @@ There's also I<$foo Magazin>, a German magazine dedicated to Perl, at
 German-speaking magazine for Perl beginners (see
 L<http://perl-zeitung.at.tf> ).
 
-Several unix/linux releated magazines frequently includes articles on Perl.
+Several unix/linux related magazines frequently includes articles on Perl.
 
 =head2 Which Perl blogs should I read?
 
index f615bf4..1f9fc92 100644 (file)
@@ -730,7 +730,7 @@ L<Regexp::Common::balanced> and L<Regexp::Common::delimited>).
 More complex cases will require to write a parser, probably
 using a parsing module from CPAN, like
 L<Regexp::Grammars>, L<Parse::RecDescent>, L<Parse::Yapp>,
-L<Text::Balanced>, or L<Marpa::XS>.
+L<Text::Balanced>, or L<Marpa::R2>.
 
 =head2 How do I reverse a string?
 
index a8d4478..1ab722c 100644 (file)
@@ -200,7 +200,7 @@ you can fit the whole thing in memory!):
 
     print $out $content;
 
-Modules such as L<File::Slurp> and L<Tie::File> can help with that
+Modules such as L<Path::Tiny> and L<Tie::File> can help with that
 too. If you can, however, avoid reading the entire file at once. Perl
 won't give that memory back to the operating system until the process
 finishes.
@@ -280,7 +280,7 @@ newlines:
     while( sysread $fh, $buffer, 4096 ) {
         $lines += ( $buffer =~ tr/\n// );
     }
-    close FILE;
+    close $fh;
 
 However, that doesn't work if the line ending isn't a newline. You
 might change that C<tr///> to a C<s///> so you can count the number of
@@ -291,7 +291,7 @@ times the input record separator, C<$/>, shows up:
     while( sysread $fh, $buffer, 4096 ) {
         $lines += ( $buffer =~ s|$/||g; );
     }
-    close FILE;
+    close $fh;
 
 If you don't mind shelling out, the C<wc> command is usually the
 fastest, even with the extra interprocess overhead. Ensure that you
@@ -1135,13 +1135,13 @@ C<$DB_RECNO> bindings, which allow you to tie an array to a file so that
 accessing an element of the array actually accesses the corresponding
 line in the file.
 
-If you want to load the entire file, you can use the L<File::Slurp>
+If you want to load the entire file, you can use the L<Path::Tiny>
 module to do it in one simple and efficient step:
 
-    use File::Slurp;
+    use Path::Tiny;
 
-    my $all_of_it = read_file($filename); # entire file in scalar
-    my @all_lines = read_file($filename); # one line per element
+    my $all_of_it = path($filename)->slurp; # entire file in scalar
+    my @all_lines = path($filename)->lines; # one line per element
 
 Or you can read the entire file contents into a scalar like this:
 
index db10643..1ab5502 100644 (file)
@@ -546,7 +546,7 @@ The output shows that Perl found the two major groups:
         <brackets in <nested brackets> >
         <another group <nested once <nested twice> > >
 
-With a little extra work, you can get the all of the groups in angle
+With a little extra work, you can get all of the groups in angle
 brackets even if they are in other angle brackets too. Each time you
 get a balanced match, remove its outer delimiter (that's the one you
 just matched so don't match it again) and add it to a queue of strings
@@ -584,7 +584,7 @@ to process. Keep doing that until you get no matches:
     }
 
 The output shows all of the groups. The outermost matches show up
-first and the nested matches so up later:
+first and the nested matches show up later:
 
     Found:
         <brackets in <nested brackets> >