This takes advantage of the -0 option to set the input record separator to 0x777 (which is not a valid character, and can not occur in your files), and the "s" option in the regex to span matching a '.' across multiple lines.perl -p0777 -i.BAK -e 's/my \$t0 = \[gettimeofday\];.+?\.\s*\$1;\s+}/ +/s;' Your.module.names.here
The explanation in this debian admin article is mostly applicable - except they use the regex option 'm' to handle a slightly different use-case.
If you wanted to match line boundaries, in addition to matching '.' across lines, the 's' and 'm' options can be used together.
Update: Minor Aesthetic change: -iBAK to -i.BAK
I hope life isn't a big joke, because I don't get it.
-SNL
In reply to Re: How to delete mutiple line from many pm files at one time
by NetWallah
in thread How to delete mutiple line from many pm files at one time
by Priti24
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |