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


in reply to Re: Using Number Ranges in a Dispatch Table
in thread Using Number Ranges in a Dispatch Table

My initial attempt was based on given but I switched to using a list of smart matches and subroutines because given has a drawback compared to dispatch tables...

With dispatch tables you can check whether a particular value can dispatch, without actually doing the dispatching yet. If your dispatch table is a hash, then it's just defined($dispatch{$value}).