- or download this
my $cnt = '0000';
while (<>) {
s/^(\*{3,})$/"$1 ". ++$cnt/e;
print;
}
- or download this
my $cnt = '0000';
while (<>) {
s/^\*{3,}\K$/" ". ++$cnt/e;
print;
}
- or download this
perl -pe'BEGIN { $cnt = '0000' } s/^(\*{3,})$/"$1 ". ++$cnt/e'
perl -pe'BEGIN { $cnt = '0000' } s/^\*{3,}\K$/" ". ++$cnt/e'