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
to eithermy $re = join '\|', keys %dispatch; if( $line =~ m/$re/ )
ormy $re = '(' . join( '|', keys %dispatch ) . ')'; if( $line =~ m/$re/ )
my $re = join( '|', keys %dispatch ); if( $line =~ m/($re)/ )
|
|---|