I also got something that got closer by doing $line =~ s/\n/\r/g; and repeating the the last two lines in your original format a bunch of times. It wraps the long line ok and places the horizontal rule underneath, but then the rest of the sig just disappears into the ether. :(
Yes, I tried /s and decided that the more efficient (?) tr would be just as well to present since they gave equally "not quite right" results. And BTW, it's cheating to repeat the last two lines of the format! :-) I have a little subroutine on the side that builds up the format string all by itself, i.e. no human intervention to say how many times to 'repeat' the lines. Although if some sample code shows how this is actually a solution, bring it on!
The other thing is, in what appears to be output below the __END__ statement, we have lost the hanging block effect I have in mind for $line. The fact that my sample text ($line) with the newlines is a signature block is irrelevant; I'm just trying to build a general purpose format statement that plays out a variable that happens to have embedded newlines. Thanks though!
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.