Since there is no "\n" in $string, nothing you type can possibly match. Add chomp($a); to remove the "\n" from $a.
In reply to Re: Perl help needed:match user input with data read from a file
by keszler
in thread Perl help needed:match user input with data read from a file
by venkatlab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |