Text::Reform - Words are wrapped whole??

G

Graham Smith

must be doing something daft but text::reform not wrapping whole words
(sometimes)
my program:
use Text::Reform;

my $format1 = "
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[";
print form $format1, "A piece of text just long enough to demonstrate
peculiar behaviour in this test";
my $format2 = "
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[";
print form $format2, "A piece of text just long enough to demonstrate
peculiar behaviour in this test";

results (under Window XP Pro):
C:\perlSrcs\ebay\test>perl test_reform.pl
A piece of text just long enough to demonstrate peculiar be-
haviour in this test
A piece of text just long enough to demonstrate peculiar
behaviour in this test

why is first use hyphenating word?
 
M

Matt Garrish

Graham Smith said:
must be doing something daft but text::reform not wrapping whole words
(sometimes)
my program:
use Text::Reform;

my $format1 = "
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[";
print form $format1, "A piece of text just long enough to demonstrate
peculiar behaviour in this test";
my $format2 = "
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[";
print form $format2, "A piece of text just long enough to demonstrate
peculiar behaviour in this test";

results (under Window XP Pro):
C:\perlSrcs\ebay\test>perl test_reform.pl
A piece of text just long enough to demonstrate peculiar be-
haviour in this test
A piece of text just long enough to demonstrate peculiar
behaviour in this test

why is first use hyphenating word?

Always read through all of the documentation (in this case, the section on
hyphenating):

use Text::Reform qw/form break_at/;

my $format1 =
"[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[";
print form { break => break_at('-') }, $format1, "A piece of text just long
enough to demonstrate peculiar behaviour in this test";
my $format2 = "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[";
print form { break => break_at('-') }, $format2, "A piece of text just long
enough to demonstrate peculiar behaviour in this test";

Output (on XP):

A piece of text just long enough to demonstrate peculiar
behaviour in this test
A piece of text just long enough to demonstrate peculiar
behaviour in this test

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top