New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] fix code examples typos in FAQ 5 #14141
Comments
From smash@cpan.orgThis is a bug report for perl from smash@cpan.org, Just fix some typos in FAQ 5 code samples. Thank you. Flags: Site configuration information for perl 5.21.5: Configured by nrc at Tue Oct 7 17:15:08 WEST 2014. Summary of my perl5 (revision 5 version 21 subversion 5) configuration: @INC for perl 5.21.5: Environment for perl 5.21.5: |
From smash@cpan.org0001-Fix-code-examples-typos-in-FAQ-5.patchFrom b55a3f9d21a38f4d8e9867be651f0b48e9867dd0 Mon Sep 17 00:00:00 2001
From: Nuno Carvalho <smash@cpan.org>
Date: Tue, 7 Oct 2014 02:37:03 +0100
Subject: [PATCH] Fix code examples typos in FAQ 5
---
cpan/perlfaq/lib/perlfaq5.pod | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpan/perlfaq/lib/perlfaq5.pod b/cpan/perlfaq/lib/perlfaq5.pod
index a8d4478..1bf6ea4 100644
--- a/cpan/perlfaq/lib/perlfaq5.pod
+++ b/cpan/perlfaq/lib/perlfaq5.pod
@@ -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
--
1.9.3 (Apple Git-50)
|
From @jkeenanIn the Perl 5 core distribution, perlfaq lives under 'cpan/'. Hence, it's maintained upstream and I am transferring the ticket to the designated upstream bug tracker. Thanks for the patch. -- |
The RT System itself - Status changed from 'new' to 'open' |
@jkeenan - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#122923 (status was 'rejected')
Searchable as RT122923$
The text was updated successfully, but these errors were encountered: