The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by morbus]

This looks like some sort of search and replace error, but there are
numerous times in the printed version of the book where @rec should be
$rec. The first occurence is on page 23:

@rec{@attrs} = split / /;

A similar occurence is on page 50, in the second code example. Thirdly,
on page 74, you've got two errors on the same line:

@rec{@fields) = split(/:/);

Notice how we start off with the hash {, but end with the array ). Anyways,
that's as far as I've gotten in this pretty decent book. Thanks for publishing
it.

--
http://www.disobey.com/
http://www.gamegrene.com/
import-bot (20211) [Avatar] Offline
#2
Re: @rec errata...
[Originally posted by dave]

> This looks like some sort of search and replace error, but there are
> numerous times in the printed version of the book where @rec should be
> $rec. The first occurence is on page 23:
>
> @rec{@attrs} = split / /;
>
> A similar occurence is on page 50, in the second code example. Thirdly,
> on page 74, you've got two errors on the same line:
>
> @rec{@fields) = split(/:/);
>
> Notice how we start off with the hash {, but end with the array ). Anyways,
> that's as far as I've gotten in this pretty decent book. Thanks for
publishing
> it.

Thanks for posting. The use of @rec{...} is correct as in these cases we're
assigning to a number of the hash elements simultaneously (the ones that are
listed in the @attrs (or @fields) array. This is called a hash slice and is
explained in a little more detail in Appendix B (bottom of p260).

The { ... ) is an error tho', and I'll get it added to the errata.

Thanks again,

Dave...
import-bot (20211) [Avatar] Offline
#3
Re: @rec errata...
[Originally posted by morbus]

Ah! Quite true - I never ran across hash slices before. You've humbled me,
thank you. Of course, now I am doubly and triply paranoid about reporting
errata - I only try to soil myself once for every forum I'm in, but I do think
this
is another:

On page 104-105, we're talking about selecting various filehandles, and
the text goes on to state (pg. 105, p1, L4) that you saved the old filehandle
into $file. Unfortunately, the examples suggest that you've saved the old
filehandle into $old.

--
http://www.disobey.com/
http://www.gamegrene.com/
import-bot (20211) [Avatar] Offline
#4
Re: @rec errata...
[Originally posted by dave]

> Ah! Quite true - I never ran across hash slices before. You've humbled me,
> thank you. Of course, now I am doubly and triply paranoid about reporting
> errata - I only try to soil myself once for every forum I'm in, but I do think
> this
> is another:
>
> On page 104-105, we're talking about selecting various filehandles, and
> the text goes on to state (pg. 105, p1, L4) that you saved the old filehandle
> into $file. Unfortunately, the examples suggest that you've saved the old
> filehandle into $old.

Well, you can hold your head high in this forum again smilie You have, in fact,
found another error.

Thank you,

Dave...