modern_perl_book icon indicating copy to clipboard operation
modern_perl_book copied to clipboard

1st ed, p77 -- strange hyphenation in code in call-out box

Open dagolden opened this issue 14 years ago • 5 comments

A line ends "$first_-". The hyphen looks like a minus sign. Identifiers in code samples should not be hyphenated across line breaks.

dagolden avatar Nov 18 '10 06:11 dagolden

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.

bubaflub avatar Feb 18 '11 19:02 bubaflub

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' :-)

legrady avatar Feb 23 '11 21:02 legrady

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.

chromatic avatar Oct 25 '11 18:10 chromatic

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

dagolden avatar Oct 25 '11 20:10 dagolden

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.

chromatic avatar Oct 25 '11 20:10 chromatic