I'm using the fill mode of formats (how 1970s, I know). If a source word is longer than the format line, it is forcibly broken at the format length. Can this be changed, so that it is output in its entirety? For example:
my $str="foobar";
format threecharformat =
^<<~~
$str
.
my $fd = STDOUT;
select((select($fd),$~ = "threecharformat")[0]);
write $fd; # use that format
The output is two lines:
foo
bar
but I want just one line:
foobar. Is it possible?
I could find nothing in perlform or perlfaq* or online about controlling the behavior when the source word overflows the format. I tried to look at the source but am far too much of a novice at Perl internals to get anywhere. (I could not even discern where formats were executed, after KEY_format, etc., were parsed.)
In the actual application, the source text contains long urls, which I don't want to be broken. In my case, it is not a stopper that the result would not then match the format.
I yield to your wisdom. Thanks. --karl@freefriends.org
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.