Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Perl
Perl Misc
Sorting based on existence of keys
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="sln, post: 4863116"] Actually, this is not why it's not clever, since you can pass length '$h{$a}' to force string context But, this is true. Too many examples to show why. Floating point, exponential, etc. It loses it's context in what length() is for... really strings. The above won't work in value context, numeric by nature with <=>. On the other hand, 'exists $h{$b}' is NOT meant to be interpreted as numeric, but as a string, since 0 can equal 0. But '' is less than '1' in a compare, but equal length numerically. The two don't mix. $xa = exists $h{$a}; string context, returns '1' for true, '' for false ^^^^^^^^^^^^^^^ Haven't tried this one, %75 of my theory works, this is the %25 haven't tried. My confidence is %100 the non-existent will decend to the bottom. Hope I cleared some stuff up. I know people will find this knowledge in the archives someday. -sln [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
Sorting based on existence of keys
Top