Wow, you researched that well enough to have found my previous struggles with it. I went away from rtf before, but this time I thought I'd try it, getting farther in a day than expected. Caller and callee look like this now:

#!/usr/bin/perl -w use strict; use 5.010; use lib "template_stuff"; use steps1; say "enter basename for file"; my $word = <>; chomp $word; # main data structure my %vars = ( fears => 'fears2.txt', causes => 'causes2.txt', width => 50, word => $word .'.rtf', ); my $rvars = \%vars; my $return = pop_texts( $rvars ); say "returned was \n $$return"; my $return2 = format_texts( $rvars, $return ); __END__
sub format_texts { use strict; use 5.010; use RTF::Writer; my ( $rvars, $reftext1 ) = @_; my %vars = %$rvars; my $text1 = $$reftext1; my $rtf = RTF::Writer->new_to_file( $vars{word} ); $rtf->prolog( 'title' => "List of fears" ); $rtf->number_pages; $rtf->print($text1); $rtf->close; return 1; }

Surprisingly, the rtf file printed out beautifully on windows, albeit without prolog, numbering, and with default margins. This will suffice for me to read it to someone else, so it is good enough for now. RTF Cookbook on CPAN is one of the better resources out there. What puzzles me specifically is how to brook the chasm between the method calls of RTF::Writer and the mark-up language itself. To blurt it out:

Q1) Where do I put the backslash sequences to create a right margin of 4000 twips?

Thanks for your comments and attention to detail.


In reply to Re^2: combining lists, formatting and printing on windows by Aldebaran
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.