Errata

Embedding Perl in HTML with Mason

Errata for Embedding Perl in HTML with Mason

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. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

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

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 12
1st paragraph in Template Toolkit section

My book is a First Edition printed in October 2002.

This is nitpicky but...

The second sentence mentions the FILTER tag twice, when it seems that it should
probably only be mentioned once.

AUTHOR: This is correct. FILTER should just be included in the list of "advanced
tags". However, this is not a serious technical mistake, it's a minor
language mistake.

Anonymous   
Printed
Page 21
middle of page

The code:

You have <% $cd_count %> cd<% $cd_count != 1 ? 's': '' %>

is missing the period (.) after the final closing %> tag.

Anonymous   
Printed
Page 23
Last code example

The first line of the <%perl> block should read:

my @words = $sentence =~ /(S+)/g;

The code in the book is missing the '$' sigil on the variable.

Anonymous   
Printed
Page 25
4th paragraph

The second to last line of the example in paragraph 4:

esethat ordsway areyay inyay Igpay Atinlay.</pig>

should instead be:

esethay ordsway areyay inyay Igpay Atinlay.</pig>

to be an accurate translation. The word "these" is "esethay" in Pig Latin.

AUTHOR: Indeed, my pig latin was mistaken ;)

Anonymous   
Printed
Page 26
first paragraph of section "Other Named Blocks"

"most of them contain plan Perl"
should read
"most of them contain plain Perl".

Anonymous   
Printed
Page 27
First line

It is currently <% $temperature %> degrees.
should be:
It is currently <% $temp %> degrees.

Anonymous   
Printed
Page 46
second line

The name "view_user.mas" somehow got turned in one instance into "view_user.max", I
think somewhere in the editing process. It should be "view_user.mas" throughout this
section.

Anonymous   
Printed
Page 73
2nd paragraph

"You should also remember that variables defined via an <%args> block are not visible
in a <%shared> block, meaning that the only access to arguments inside a shared block
is via the %ARGS hash or one of the request object methods such as request_args."

It's not true that you can access args via %ARGS in a shared block. You can only
access args via $m->request_args.

Anonymous   
Printed
Page 74
second line of example 5-3 (/autohandler)

<& $m->call_next &>

should be:

% $m->call_next;

As written the example would attempt to call a component as specified by the return
value of $m->call_next, which probably isn't intended.

Anonymous   
Printed
Page 110
Last paragraph

This paragraph should be intended to match those above it, as it applies to the
previous list item.

Anonymous   
Printed
Page 129
First comment in first code block

Sometimes we may want to path in a query
should read:
Sometimes we may want to pass in a query

Anonymous   
Printed
Page 147
top half of page

The site admin <input> tag is missing its closing '>'.

Anonymous   
Printed
Page 157
middle of page

The closing </form> tag incorrectly appears as <form>

Anonymous   
Printed
Page 190
Example 11-2

There are two errors in this code block:
In the Cache::FileCache->new line, there is a missing { before namespace.
Add 'use Cache::FileCache' to the <%once> section.

Anonymous   
Printed
Page 191
First code example under "Putting the Session ID in the URL" heaing

The code example show should be:

<%filter>
s/href="([^"])+"/'href="' . add_session_id($1) . '"'/eg;
s/action="([^"])+"/'action="' . add_session_id($1) . '"'/eg;
</%filter>

Anonymous   
Printed
Page 191
Near bottom

These substitution filters also recognize URLs in single quotes.
I think they're better than the fix proposed in the official errata.

s/(href=)(['"])([^2]+?)2/$1.$2.add_session_id($3).$2/eg; #'
s/(action=)(['"])([^2]+?)2/$1.$2.add_session_id($3).$2/eg; #

Anonymous   
Printed
Page 204
2nd paragraph, right before 1st example

"This example lets you give each developer their own hostename:"
^
should be:
"This example lets you give each developer their own hostname:"

Anonymous   
Printed
Page 232
footnote

The reference to HTML::Mason::Request::WithApacheSession is outdated, as the module's
name has changed to MasonX::Request::WithApacheSession

Anonymous   
Printed
Page 234
Last sentence on the page

While you _could_ pass a request_class parameter to the Interp constructor, you
probably _should_ be passing it to the ApacheHandler constructor. Because of Mason's
"contained object" system, there's no need to create an Interp directly. The
ApacheHandler constructor will create one for you and pass it any relevant
parameters.

Creating an Interp object manually will cause problems if you don't also give it the
correct resolver_class parameter. ApacheHandler takes care of this for you.

Anonymous   
Printed
Page 254
first table

There are two parameters listed with dashes in their name, "Mason-CodeCacheSize" and
"Mason-IgnoreWarningsExpr". These are both incorrect, neither should have a dash.

Anonymous   
Printed
Page 260
Beginning of text

It should be mentioned here that current versions of Bricolage (as of 1.4.3) do not
yet work with Mason 1.1x, because of API changes in Mason between 1.05 and 1.10. The
book covers the Mason 1.1x API, so this might be a little confusing.

Hopefully a near-future verson of Bricolage will also support Mason 1.1x.

Anonymous