It sounds like you are "slurping" the whole file at once. Check the value of $/ (input record separator) when you read in your file.
In reply to Re: print line containing string
by ChiefAl
in thread print line containing string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |