in reply to Re^2: Multiple If Selections
in thread Multiple If Selections

Excellent suggestion++. You forgot the capturing parentheses, though, so instead of wondering why the dispatch table and the subs are working together you'll be wondering why $1 isn't what you think it is. :-)

Change

my $re = join '\|', keys %dispatch; if( $line =~ m/$re/ )
to either
my $re = '(' . join( '|', keys %dispatch ) . ')'; if( $line =~ m/$re/ )
or
my $re = join( '|', keys %dispatch ); if( $line =~ m/($re)/ )