Skip to content
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

Closed
p5pRT opened this issue Oct 7, 2014 · 5 comments
Closed

[PATCH] fix code examples typos in FAQ 5 #14141

p5pRT opened this issue Oct 7, 2014 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 7, 2014

Migrated from rt.perl.org#122923 (status was 'rejected')

Searchable as RT122923$

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2014

From smash@cpan.org

This is a bug report for perl from smash@​cpan.org,
generated with the help of perlbug 1.40 running under perl 5.21.5.


Just fix some typos in FAQ 5 code samples.

Thank you.



Flags​:
  category=docs
  severity=low
  Type=Patch
  PatchStatus=HasPatch


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​:
  Commit id​: 10495b9
  Platform​:
  osname=darwin, osvers=13.4.0, archname=darwin-2level
  uname='darwin s-book.local 13.4.0 darwin kernel version 13.4.0​: sun aug 17 19​:50​:11 pdt 2014; root​:xnu-2422.115.4~1release_x86_64 x86_64 '
  config_args='-des -Dusedevel'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
  optimize='-O3',
  cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.51)', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /usr/lib
  libs=-ldbm -ldl -lm -lutil -lc
  perllibs=-ldl -lm -lutil -lc
  libc=, so=dylib, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'


@​INC for perl 5.21.5​:
  lib
  /usr/local/lib/perl5/site_perl/5.21.5/darwin-2level
  /usr/local/lib/perl5/site_perl/5.21.5
  /usr/local/lib/perl5/5.21.5/darwin-2level
  /usr/local/lib/perl5/5.21.5
  .


Environment for perl 5.21.5​:
  DYLD_LIBRARY_PATH (unset)
  HOME=/Users/nrc
  LANG (unset)
  LANGUAGE (unset)
  LC_CTYPE=
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/Users/nrc/Library/Haskell/bin​:/usr/bin​:/bin​:/usr/sbin​:/sbin​:/usr/local/bin​:/usr/texbin
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2014

From smash@cpan.org

0001-Fix-code-examples-typos-in-FAQ-5.patch
From 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)

@p5pRT
Copy link
Author

p5pRT commented Oct 8, 2014

From @jkeenan

In 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.

perl-doc-cats/perlfaq#52

Thanks for the patch.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 8, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT p5pRT closed this as completed Oct 8, 2014
@p5pRT
Copy link
Author

p5pRT commented Oct 8, 2014

@jkeenan - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant