Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
[SOLVED: Can we make hash key check in 'if' condition case insensitive?by Perl300 (Friar) |
on Feb 08, 2018 at 21:47 UTC ( [id://1208755]=perlquestion: print w/replies, xml ) | Need Help?? |
Perl300 has asked for the wisdom of the Perl Monks concerning the following question: Hi all. I am using this same approach from "Intermediate Perl" to check if an element of two dimensional array exist in a hash: My problem is, the strings I'll have in @castaways and @list_1 are uppercase as well as lowercase. So as of now, the if condition fails if the string in @castaways is 'Hello' while in @list_1 it is 'hello'. Is there any way to make the if condition do case insensitive match? I am trying to avoid making any change in the @castaways and @list_1 as they are taken from different sources and will be sent to other applications for processing. I don't know if changing case would mess things up for others. UPDATE: Marked as solved in subject.
Back to
Seekers of Perl Wisdom
|
|