in reply to Re: Newline after every 5 periods
in thread Newline after every 5 periods
Thank you, that works! What's the 0056 doing?
I'd also like to randomize these paragraph breaks in a range of 5 - 19 periods (not just every n periods), and output to new file. Here's what I've got; the while loop/output isn't right. If it's more appropriate to edit my initial post or make a new post I will. Thanks.
#!/usr/bin/perl use strict; use warnings; my $filename = 'input.txt'; my $out = 'ouput.txt'; my $minimum = 5; my $range = 19; my $random_number = int(rand($range)) + $minimum; open(my $fh, '>>', $filename) or die "Could not open file '$filename +' $!"; while(my $fh) { print my $fsh('$_.="\n\n" x !(++$c % $random_number')); #compilatio +n error }; close $fh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Newline after every 5 periods
by choroba (Cardinal) on Jul 20, 2016 at 12:50 UTC | |
by paulm2 (Initiate) on Jul 20, 2016 at 13:12 UTC | |
|
Re^3: Newline after every 5 periods
by AnomalousMonk (Archbishop) on Jul 20, 2016 at 14:01 UTC | |
by paulm2 (Initiate) on Jul 20, 2016 at 14:13 UTC |