Could it be that when you read from <STDIN> you are getting an automatic newline character that is affecting your search? Try chomp. qr may be of interest to you as well.
In reply to Re: Using a regex pattern from STDIN
by pbeckingham
in thread Using a regex pattern from STDIN
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |