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


in reply to Re^2: elsif chain vs. dispatch
in thread elsif chain vs. dispatch

Note also that hash lookups are, worst case, Θ(N). There's always a chance that all hash keys map to the same value, resulting in a linear list that needs to be searched.

I recall that perls from 5.8.3 or so have code in place to watch out for this sort of degenerate case, and will rehash to prevent this from occurring.

• another intruder with the mooring in the heart of the Perl