Errata

Spidering Hacks

Errata for Spidering Hacks

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 48
top of script

The "$|++" should be bold. The text explains that the only meaningful change is in bold.
Without this change, the progress bar is buffered, and the point of the hack is lost.

Anonymous   
Printed Page 50
in the foreach loop

In the progress bar examples, you call ua->head() to get the content-length, then
make a separate call to ua->get() to get the data, passing the content-length to the
progress callback via the lexical variable $total_size. This is not necessary. The
$response value passed to the callback contains the Content-Length header, so you can
avoid the call to ua->head() altogether by rewriting callback() as

sub callback {
my ($data, $response, $protocol) = @_;
$final_data .= $data;
print progress_bar(
length($final_data),
$response->header('Content-Length'),
25,
'=');
}

Anonymous   
PDF Page 93
first line of normal text after code

If you’ve read through the transplate.pl code, you’ve seen that it simply takes

should be translate.pl

Good book!

Andy Riden  Nov 19, 2014