Compare two strings regardless of case size in perl -
Is there any way to compare two strings regardless of size size? For example
"steve" acu "steve" and "-" - this "SHOE" will match eck "shoe"
$ perl -e 'print uk ("steve") eq uc ("STevE"); Print "\ n"; '1 $ perl -e' print uc ("SHOE") eq uc ("shoe"); Print "\ n"; '1 $ perl5.8 -e' print uk ("shoe") eq uc ("shoe1"); Print "\ n"; '$
You can also explicitly use as lc ()
.
If you want the actual "eq" operator to be case insensitive, it may be possible using the surcharge, but I do not think what you are asking - please clarify your question if it That's the case. Nor is it a great idea if you want, IMHO - is very delicate and it is probably difficult to trace and debug the bugs.
In addition, this is an overkill in your specific case where you want parallelism, but case-independent modifier "i" in Perl Regular Expressions
Comments
Post a Comment