in reply to
Error using grep
Use a regex and add boundary conditions \b if you want them:
if (grep {/\Q$key\E/} @lines) {
[download]
Comment on
Re: Error using grep
Download
Code
In Section
Seekers of Perl Wisdom