wrap this

bschoate on 2001-09-06T18:26:03

I just spent two hours tracking down a bug in a program where some text comes in with two spaces at one point in a paragraph and leaves (via email) with what appeared to be 7.

As it turns out, the text is being formatted using the Text::Wrap package, an excellent little module for wrapping a paragraph of text at a particular column.

What I didn't know was that the wrap() function uses routines in Text::Tabs to optimize whitespace, replacing them with tabs where it can.

That's just great, but why isn't this aspect of wrap() documented in the POD documentation? There is no mention of its use of Text::Tabs at all!

In order to work around this, I had to set $Text::Tabs::tabstop to some high magic number to keep it from altering my whitespace like that.

Fume.

NB: I contacted Text::Wrap author David Muir Sharnoff and he tells me that the next release of Text::Wrap will document this 'feature'.

Thanks, David. It never hurts to ask.