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 cperljim]

Your succinct explanation of references (pp. 268-272) provided the help I
needed to (finally) understand an important part of Perl. Thanks!

BTW, there are some very minor errata in Appendix B (excluding ones posted
previously):

1. Page 260: the "while" statement has an extra ')'
while ( ($type, $count) = each %rings) ) [sic] {"
It should be:
while ( ($type, $count) = each %rings ) {

2. Page 260, 4th comment from bottom of page: missing _ in %minor_rings
# creates a new hash called %minor rings [sic] containing
It should be:
# creates a new hash called %minor_rings containing

3. Page 265, while loop syntax: "statements" should have a semicolor after it
to maintain consistency with previous syntax examples (i.e., for loop, foreach
loop).

A couple of comments:

a. Regarding the "for" loop syntax, you use "initialisation; test; increment".
In general, I prefer the term "update" instead of "increment" because any
valid expression - including decrement - may be used.

b. I noticed that you did not mention the "do" block (it's not a loop!) and
that's probably a good thing considering the scope and intent of Appendix B.
When I was beginning to use Perl I erroneously thought "do" was another type
of loop... and could not understand why last, next and redo weren't working!
import-bot (20211) [Avatar] Offline
#2
Re: Appendix B
[Originally posted by dave]

> Your succinct explanation of references (pp. 268-272) provided the help I
> needed to (finally) understand an important part of Perl. Thanks!

Glad to hear it. Thanks for letting me know!

> BTW, there are some very minor errata in Appendix B (excluding ones posted
> previously):
>
> 1. Page 260: the "while" statement has an extra ')'
> while ( ($type, $count) = each %rings) ) [sic] {"
> It should be:
> while ( ($type, $count) = each %rings ) {
>
> 2. Page 260, 4th comment from bottom of page: missing _ in %minor_rings
> # creates a new hash called %minor rings [sic] containing
> It should be:
> # creates a new hash called %minor_rings containing
>
> 3. Page 265, while loop syntax: "statements" should have a semicolor after it
> to maintain consistency with previous syntax examples (i.e., for loop, foreach
> loop).

Thanks for those. Looks like I'm going to be busy on the errata for a couple
of days smilie

> A couple of comments:
>
> a. Regarding the "for" loop syntax, you use "initialisation; test; increment".
> In general, I prefer the term "update" instead of "increment" because any
> valid expression - including decrement - may be used.

That's a very good point. I'm not sure I like "update", but I should think of
something else.

> b. I noticed that you did not mention the "do" block (it's not a loop!) and
> that's probably a good thing considering the scope and intent of Appendix B.
> When I was beginning to use Perl I erroneously thought "do" was another type
> of loop... and could not understand why last, next and redo weren't working!

Maybe I should mention "do" and make it clear it's not a loop. Or perhaps that
would just get too confusing!

Thanks for all of your comments.

Dave...