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
    > What's 056 doing?

    See perlrun for the -0 option, and

    perl -wE 'say "\056"' .

    for the meaning of 56.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      thanks! 056 = begins at period alias 0.
Re^3: Newline after every 5 periods
by AnomalousMonk (Archbishop) on Jul 20, 2016 at 14:01 UTC

    You seem to have changed your post above by deleting some or all of the original question: What's 056 doing?

    This makes choroba's reply seem incoherent at best, since he seems to be answering a question that no one has asked.

    Please don't change or delete material in your posts in a way that destroys context. Please see How do I change/delete my post? to learn the ways of righteous alteration.


    Give a man a fish:  <%-{-{-{-<

      Sorry about that.