How about this?
perl -pe'open _,file2;0+$_~~[<_>]or$_=""' file147 chars, versus 91 (84, removing unnecessary whitespace). This one's definitely "just for fun", though, due to now-experimental smartmatch and re-reading of file2.
In reply to Re^2: extract line
by rjt
in thread extract line
by lallison
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |