Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use utf8;
- use open qw(:encoding(utf8) :std);
- open my $in, '<', 'dat' or die;
- my $prev = 0;
- while (<$in>) {
- chomp;
- if (/\A\.\z/) {
- print ".\n";
- $prev = 0;
- next;
- }
- if ($prev) {
- print ' ';
- }
- print $_;
- $prev = $_;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement