Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.98k stars 559 forks source link

Documentation error in perltoot #110

Closed p5pRT closed 20 years ago

p5pRT commented 25 years ago

Migrated from rt.perl.org#914 (status was 'resolved')

Searchable as RT914$

p5pRT commented 25 years ago

From Jon.Waddington@janus.com

I noticed a minor error in the perltoot.html documentation. The "Other Object Methods" section contains a sample object method\, shown here​:

  sub exclaim {   my $self = shift;   return sprintf "Hi\, I'm %s\, age %d\, working with %s"\,   $self->{NAME}\, $self->{AGE}\, join("\, "\, $self->{PEERS});   }

This method should read​:

  sub exclaim {   my $self = shift;   return sprintf "Hi\, I'm %s\, age %d\, working with %s"\,   $self->{NAME}\, $self->{AGE}\, join("\, "\, @​{$self->{PEERS}});   }

The first bit of code returns the reference to the array in question\, not the array itself (at least on my machine). Later in the section\, we are warned about the tradeoffs of using direct hash access\, which is a bit ironic.

As I said\, this is very minor\, but I just thought someone should know....

Jon Waddington jon.waddington@​janus.com


Site configuration information for perl 5.00503​:

Summary of my perl5 (5.0 patchlevel 5 subversion 03) configuration​:   Platform​:   osname=MSWin32\, osvers=4.0\, archname=MSWin32-x86-object   uname=''   hint=recommended\, useposix=true\, d_sigaction=undef   usethreads=undef useperlio=undef d_sfio=undef   Compiler​:   cc='cl.exe'\, optimize='-Od -MD -DNDEBUG -TP -GX'\, gccversion=   cppflags='-DWIN32'   ccflags ='-Od -MD -DNDEBUG -TP -GX -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_OBJECT'   stdchar='char'\, d_stdstdio=define\, usevfork=false   intsize=4\, longsize=4\, ptrsize=4\, doublesize=8   d_longlong=undef\, longlongsize=8\, d_longdbl=define\, longdblsize=10   alignbytes=8\, usemymalloc=n\, prototype=define   Linker and Libraries​:   ld='link'\, ldflags ='-nologo -nodefaultlib -release -machine​:x86'   libpth="C​:\Perl\lib\core"   libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib PerlCRT.lib   libc=C​:\Perl\lib\core\PerlCRT.lib\, so=dll\, useshrplib=yes\, libperl=perlcore.lib   Dynamic Linking​:   dlsrc=dl_win32.xs\, dlext=dll\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags=' '\, lddlflags='-dll -nologo -nodefaultlib -release -machine​:x86'

Locally applied patches​:   ACTIVEPERL_LOCAL_PATCHES_ENTRY


@​INC for perl 5.00503​:   C​:/Perl/lib   C​:/Perl/site/lib   .


Environment for perl 5.00503​:   HOME (unset)   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)

PATH=C​:\Perl\bin;C​:\Perl\bin;C​:\Perl\lib;C​:\WINNT\system32;C​:\WINNT;C​:\Prog ram Files\BusinessObjects;C​:\ORANT\BIN;C​:\PROGRA~1\MICROS~1\Office;C​:\SQLLIB\BI N;C​:\SQLLIB\FUNCTION;C​:\Sybase\DLL;C​:\Sybase\BIN;C​:\SNA\system;Z​:.;C​:\PROGR A~1\EXTRA!   PERL_BADLANG (unset)   SHELL (unset)