in reply to Re^5: Substitution don't work with a special inputfile
in thread Substitution don't work with a special inputfile

Thank you poj for helping me again, now it works like a charm. I have tried to solve the remaining problem by myself like this:

#!/usr/bin/perl # Remove extra text from a PGN or Text-file. use strict; use warnings; my $regex = '{\[%tqu[^\]]*]}'; my $line = do { local $/; <>; }; $line =~ s/\n/ /g; $line =~ s/$regex//gi; # these statements I have inserted $line =~ s/\]/\]\n/g; $line =~ s/\[E/\n\[E/g; # end $line =~ s/ (\d+\. )/\n$1/g; print $line;

and it "nearly" worked, but I got an empty first line in the outputfile.