Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 1ef7f58132e7981d8f0627ab91195484 > files > 9

perl-Perl6-Slurp-0.51.3-2.mga4.noarch.rpm

use Perl6::Slurp;

sub squeeze {
    my ($removed) = @_;
    if ($removed =~ tr/\n/\n/ == 1) { return " " }
    else                            { return "\n\n"; }
}

print slurp(\*DATA, {irs=>qr/[ \t]*\n+/, chomp=>\&squeeze}), "\n";

__END__
This is the
first paragraph


This is the
second
paragraph

This, the
third




This one is
the
very
last