SPUG: Doc. bug on glob() in 3rd ed. Camel
Tim Maher
tim at consultix-inc.com
Tue Jan 18 17:14:39 PST 2005
The 3rd ed. Camel, p. 727 on "glob" says [^abc] complements the
list (as in C-shell), but it is really ! that does that, as in
Bourne/Korn/Bash shells. And this documentation bug is not listed at
O'Reilly's errata page for this book.
There's a demonstration below; any comments/insights/disproofs?
-Tim
$ ls
!.! ^.^ a.a b.b o.o
$ perl -wle '$,="\n"; print <*.*>'
!.!
^.^
a.a
b.b
o.o
# 3rd ed. Camel p.727 says circumflex is negater -- NOT!
$ perl -wle '$,="\n"; print <*.[^oa]>'
^.^
a.a
o.o
# It's really "!" that's the negater:
$ perl -wle '$,="\n"; print <*.[!oa]>'
!.!
^.^
b.b
$
Tested on Suse Linux 8.1 with Perl 5.8.0, and SunOs 9.0, with Perl 5.8.5,
issuing Perl commands from both C-shell and Bash shell. All results same
as shown above. I rest my case! 8-}
--
*--------------------------------------------------------------------------*
| Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX |
| tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com |
*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*
| Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" |
| Classes: 2/14: Minimal Perl 2/15: Hashes & Arrays 2/16-18: Int. Perl |
*--------------------------------------------------------------------------*
More information about the spug-list
mailing list