Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: combining lists, formatting and printing on windows

by Aldebaran (Curate)
on Apr 19, 2015 at 02:41 UTC ( [id://1123925]=note: print w/replies, xml ) Need Help??


in reply to Re: combining lists, formatting and printing on windows
in thread combining lists, formatting and printing on windows

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....

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1123925]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-26 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found