#!usr/bin/perl -w $foo = ; $foo =~ s/\+eol\d'/\n/g; print $foo; print "\n\n Done\n"; __DATA__ AAA+XXXX+1234++here?'s some text+eol1'BBB+XXXX+1234++here?'s some text+eol2'CCC+XXXX+1234++here?'s some text+eol3'etc.