modern_perl_book
modern_perl_book copied to clipboard
1st ed, p77 -- strange hyphenation in code in call-out box
A line ends "$first_-". The hyphen looks like a minus sign. Identifiers in code samples should not be hyphenated across line breaks.
The same happens on p14 of the 1st edition in the paragraph "Package-Qualified Names" on the PDF (letter) version. The last sentence of the first paragraph starts "That is, My::Fine::-Package refers to..."
Package names should not be hyphenated across line breaks either.
pg 53 (pdf) in the Hash references section refers to:
... prepended scalar sigil: $$colors_-
ref{$color}, ...
And I won't even complain about Yanks mis-spelling 'colour' :-)
Linebreaking is tricky. Hyphenation seems like the least bad of all alternatives (where the worst alternative is manual linebreaking for multiple output sizes). I'll leave this open, pending a better approach--perhaps I'll decide that eschewing the hyphen is correct.
It's ironic, since the source is POD which wouldn't have this problem anyway (nor would HTML, which only breaks white-space, generally).
Depending on the conversion tool, maybe there is a way to mark code spans of text as non-breaking?
-- David
I'm not sure it's possible to solve this in general without line-by-line manual layout for all printed materials, and that probably requires rewriting the text. I don't want to give up full justification, and I have to respect margins and gutters on physical pages. Even so, A::Very::Long::Module::Name rendered in a monospace font (or as I encountered the other day, a very long URL) could be wider than the maximum printable width of a page.
I can make the callout frames a little wider to make this less likely, but I'm not sure it's possible to eliminate linebreaking altogether.