kbrede (3) [Avatar] Offline
#1
On page 68 "-wnl" has two hypens. At least this is the case for the online PDF version.

perl –wnl -e '/Matthew/ and print $ARGV and close ARGV;' \r
> addresses.dat members
members

Incidentally I purchased the book and really like it so far. Not only am I learning about Perl, I'm learning a few things I didn't know about Linux smilie
Kent
tmaher (37) [Avatar] Offline
#2
Re: page 68 errata
> On page 68 "-wnl" has two hypens. At least this is
> the case for the online PDF version.
>
> perl –wnl -e '/Matthew/ and print $ARGV and close
> ARGV;' \r
> > addresses.dat members
> members

Hmm... The hyphen-count looks correct to me in both the PDF and printed editions.
But I know from my own experience that PDF images can sometimes look a bit distorted,
because in some contexts the Acrobat "line-drawing engine" gets a little carried away.
Also, if you're "smearing pixels" by using, for example, 1024x768 resolution on an LCD
monitor with native resolution of 1280x1024, a single hyphen could easily get extended
a bit, and to different degrees at different screen positions.

I suspect that one of these factors accounts for your experience. But thanks anyway for your report! 8-}

> Incidentally I purchased the book and really like it
> so far. Not only am I learning about Perl, I'm
> learning a few things I didn't know about Linux smilie
> Kent

I'm delighted to hear that, because of course the whole point of writing
this particular book was to help people see the connections between Perl and UNIX/Linux,
and make the most of them! 8-}

-Tim
kbrede (3) [Avatar] Offline
#3
Re: page 68 errata
Interesting, I'm using 1280x1024. When I view the PDF in Evince and copy paste I get the following:

perl –wnl -e '/Matthew/ and print $ARGV and close ARGV;'
perl -wnl -e '/1/ and print $ARGV and close ARGV;'

As you can see the first line's hyphen is slightly longer, at least on my screen, and when I paste it to the command line I get not a "--" but just a very long hyphen.

When I paste from Xpdf, the first hyphen doesn't even show as you can see below, but it does paste correctly onto the command line. Go figure smilie

perl ­wnl -e '/Matthew/ and print $ARGV and close ARGV;'
perl -wnl -e '/1/ and print $ARGV and close ARGV

Not a big deal, there's a bug somewhere, but not enough to warrant hunting it down. I just thought I'd point it out.
Kent
kbrede (3) [Avatar] Offline
#4
Re: page 68 errata
What kicked this off was I got an error message after pasting the command:

kbrede:~$ perl –wnl -e '/Matthew/ and print $ARGV and close ARGV;' file
Can't open perl script "–wnl": No such file or directory

A double hypen actually reports this:

kbrede:~$ perl --wnl -e '/Matthew/ and print $ARGV and close ARGV;' file
Unrecognized switch: --wnl (-h will show valid options).

Anyway enough of all that.........
Kent