$elements[0] is present in the array @keys, but this code is not matching them, what am I missing? is it something to do with string comparison with quotes and no quotes?.... .... for (....) { push @keys,$key; } my (@elements) = split ';',$line; if ((grep { $elements[0] eq '$_' }@keys)) { print "found"; }
In reply to String comparison in an array by newperlbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |