Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^5: Sorting hash

by ablanke (Prior)
on Apr 05, 2018 at 22:56 UTC ( #1212388=note: print w/replies, xml ) Need Help??


in reply to Re^4: Sorting hash
in thread Sorting hash

Hi,

you are right, but you get an warning:

Argument "0.04%" isn't numeric in numeric comparison (<=>)

the sorting order, in this trivial example, is the same, but who knows what shows up in the real world.

so a numeric compare seems to be the more obvious choice in this case.

of course there are several ways to get rid of the warnings and using numeric comparison.

Replies are listed 'Best First'.
Re^6: Sorting hash
by pryrt (Monsignor) on Apr 05, 2018 at 23:01 UTC
    You're right. That'll remind me to turn on warnings even for oneliners...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1212388]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2022-05-20 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (73 votes). Check out past polls.

    Notices?