Note that . matches every character but a newline, so there's no need to worry about chomping. See s in Modifiers in perlre.while (<FILE>) { if (/(.*$find.*)/) { $header = $1; } elsif (/^\s{38}\S*/) { print NEW "$header\t", $_; } }
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re: Caputre Entire Line Not Just Find
by kennethk
in thread Caputre Entire Line Not Just Find
by jlope043
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |