Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: Can we make hash key check in 'if' condition case insensitive?

by syphilis (Chancellor)
on Feb 09, 2018 at 13:03 UTC ( #1208821=note: print w/replies, xml ) Need Help??


in reply to Re^4: Can we make hash key check in 'if' condition case insensitive?
in thread [SOLVED: Can we make hash key check in 'if' condition case insensitive?

You're free to use another implementation if you don't want to use perl's

I wasn't trying to imply that I have a better recommendation - I don't.
Personally, I will just use lc(), as it is quite adequate for the situations in which I use it.
However, just as there are situations in which lc() does not do the right thing, there are also portability issues with fc() - and I think it would have been better if you had mentioned those portability issues when you said that "fc should be used for case-insensitive comparisons, not lc".

I suspect that *you* are so well aware of that portability issue, that it didn't even occur to you to mention it.
But dumb pricks like me are not so quick on the uptake, especially when the crucial information is held back until the very end of the documentation (not your fault).

This is one of the interesting aspects of the way that Larry Wall has "stitched up" perl5.
In a normal situation, if there were a number of features that we wished to add to perl, the porters would just release a new version of perl named "perl-6.0.0" - a version of perl that provided those new features whilst promising no compatibility (yet providing extensive compatibility) with perl-5.x.x.
But Larry has successfully (and with deliberate intention) ensured that can't happen.
Therefore, in accordance with the backward-compatibility of perl-5.x.x, the only way that new features can be added is via 'use feature'.
I expect that, by about perl-5.36.0, the recommendation will no longer be that you start your perl script with:
use strict; use warnings;
Rather, it will be that you begin your scripts with:
use strict; use warnings; use feature ':5.26.0';
And, with 5.46.0, you begin your scripts with:
use strict; use warnings; use feature ':5.36.0';
... or something along those lines.

The disappointing thing about that is that there's a large number of monks here (1nickt ++ is a notable exception) who think that's completely acceptable.

Cheers,
Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208821]
help
Chatterbox?
and all is calm...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2018-02-25 22:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (315 votes). Check out past polls.

    Notices?