Alright, thanks, lcfirst works well, but I'll be darned if I can cobble the whole thing together yet. I want now to insert 'Fear of' at the beginnning of the sentence, and I can't accomplish it. It makes no sense to me why it doesn't appear while the numbered match variables do:

$ ./fears1.pl enter basename for file rt2 returned was 0. dying exists because it's everyone's greatest terror, likely laden + with pain. 1. abject poverty exists because my earning power has been decreasing +and a regime is on the ascendance that wants to crush my class. 2. being homeless exists because it's awful and the result of 1. 3. cancer, disease exists because it runs in the family and can happen + spontaneously with appreciable probability. it's expensive. $

The caller has changed a bit, but the substitution happens here:

sub pop_texts { use strict; use 5.010; use File::Slurp; my ($rvars) = shift; my %vars = %$rvars; my @fears = read_file( $vars{fears} ); my @causes = read_file( $vars{causes} ); for (@fears) { s/\s+$/ /; $_ = lc($_); s/^(\d+\. )(.) /$1 Fear of $2/; } for (@causes) { s/^\d+\./exists because/; $_ = lc($_); } #say "causes are @causes"; my $text1 = ''; for my $i ( 0 .. $#causes ) { $text1 = $text1 . $fears[$i] . $causes[$i] . "\n"; } my $reftext = \$text1; return $reftext; }

I tried putting it in single quotes to no avail....


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.