Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by OldChamp (Acolyte)
on Aug 25, 2015 at 08:40 UTC ( #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? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2022-10-01 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (126 votes). Check out past polls.

    Notices?