http://www.perlmonks.org?node_id=1053669


in reply to Re: Multiple Conditional Statements
in thread Multiple Conditional Statements

This should work as the original values are numbers, but this is inefficient as the numeric values have to be stringified to be put as keys the hash. And the hash construction itself counts too.

Replies are listed 'Best First'.
Re^3: Multiple Conditional Statements
by TJPride (Pilgrim) on Sep 12, 2013 at 22:01 UTC
    That only matters if you are working with literally millions of items, and the alternative is far worse. Constructing a hash is more efficient than, say, sorting a large list of items.