Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^6: Substitution don't work with a special inputfile

by OldChamp (Acolyte)
on Aug 25, 2015 at 08:40 UTC ( [id://1139800]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1139800]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-03-29 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found