data.txt:
hello world goodbye mars goodbye perl6 hello perl5
myprog.py:
my $fname = 'data.txt'; my $infile = open($fname, :r, nl => "\n\n"); for $infile.lines(nl => "\n\n") -> $para { say $para; say '-' x 10; }
Actual output:
hello world ---------- goodbye mars ---------- ---------- goodbye perl6 ---------- back to perl5 ----------
Required Conclusion:
hello world goodbye mars ----------- goodbye perl6 back to perl5 -----------
...
$ perl6 -v This is perl6 version 2015.03-21-gcfa4974 built on MoarVM version 2015.03
source share