Your latest question (--) seems to me to suggest that you ignored or didn't understand
ikegami's earlier explanation that text-wrapping MEANS inserting a <CR> at the end of the (wrapped) line... and the observation that Text::Wrap breaks on word boundaries.
Then, your comment,
012: # strip out all Carriage Returns
013: #
014: # Process the file by replacing each tilde (~) with a carriage return / line feed and
015: # save the file in the correct file format.
matches neither what you say you want to do, nor what you are doing. There's no mechanism in your code to remove "carriage returns" ... and you can't very well replace each tilde with a "carriage return" and retain the tildes.
What's more, the output I see appears to retain the tildes.
So perhaps you should clarify your question (preferably, after clearing up your understanding of what text-wrapping IS and what Text::Wrap DOES (for which, perldoc Text::Wrap should help.)
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.