On each trip around the while( <INPUT> ) loop, you do:
my $pattern = pop @lines;
Which leaves @lines empty. But you never refill it for the next trip around the while( <INPUT> ) loop.
Also see quotemeta if you want to do literal matches and match dot as dot instead of a wildcard.
In reply to Re: Look for pattern in file. ????
by Corion
in thread Look for pattern in file. ????
by davidinottawa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |