Perl: the Markov chain saw | |
PerlMonks |
Re^2: how to check for a word in a file and if found remove that line, the above line and the below line from the file.by Discipulus (Canon) |
on Jan 20, 2016 at 09:37 UTC ( [id://1153158]=note: print w/replies, xml ) | Need Help?? |
I was sure it would be easier with splice but i falled in the 'modifying an array while iterating over it' pitfall.. To avoid a copied data I needed to undef some value and grep for defined values when printing the copy output.. anyway it works. I have modified the DATA a little to be easier to follow
L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|