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


in reply to Replacing If Elsif Else with Hash

It worked fine in the script as it was, but when I placed that script into a external subroutine, it broke things...

I endorse your desire to use a dispatch table of some kind rather than the original approach, but I am curious to know how things 'broke' when you copied the  if ... elsif ... else structure to other code. Can you elaborate?