You can add some debug information in your grep while testing, like this:
The issue is that simple quotes prevent interpolation (ie, perl will keep the content unmodified). A bare $_ should do the trickgrep { print $elements[0], '$_', "\n"; $elements[0] eq '$_' } @keys;
In reply to Re: String comparison in an array
by Eily
in thread String comparison in an array
by newperlbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |