Easiest answer for Q1 probably is lcfirst, at least as long as none of your causes don't start out with a proper name, which lcfirst also would mercilessly "downsize" :-)

As for Q2, first thing that comes to my mind is fmt, but perhaps Text::Format suits your needs better. For a solution without CPAN, your function would look for the last spaces before your width, output that substring, and then work on the rest of the string.

The OS wouldn't make a difference, as long as you use a monospaced font. Otherwise, I'd preferredly output something like RTF (e.g. RTF::Writer), which can be shown/printed by even the older versions of Windows' text processors such as Write; or PDF, which you have heard of :-)

Update: I thought you'd run perl on the same system where you want the output - then you'd get the correct line endings by default (at least Strawberry does this for me).
Perhaps the :crlf Layer from PerlIO might help... Looks like the easiest way for you is to use "\r\n" in place of pure "\n" - see the thread hinted to by FreeBeerReekingMonk. But if by "printing" (in the subject) mean "sending to paper", RTF (which is to TeX what PHP is to Perl) is better, because every Windows can print that "out of the box".


In reply to Re: combining lists, formatting and printing on windows by soonix
in thread combining lists, formatting and printing on windows by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.