in reply to String comparison in an array
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: String comparison in an array
by BillKSmith (Monsignor) on Aug 08, 2018 at 13:27 UTC | |
|
Re^2: String comparison in an array
by newperlbie (Acolyte) on Aug 08, 2018 at 12:50 UTC | |
by Eily (Monsignor) on Aug 08, 2018 at 13:03 UTC | |
by newperlbie (Acolyte) on Aug 08, 2018 at 13:26 UTC | |
by Eily (Monsignor) on Aug 08, 2018 at 14:01 UTC | |
by newperlbie (Acolyte) on Aug 08, 2018 at 14:16 UTC | |
|