in reply to
Avoiding if/else knots II
When the order is not important you can insert "()" around the constant parts of the keys and match
$m=join"|",keys%table;$code=~/$m/
then you can dispatch on
($m=~/|([^|]*$1[^|]*)|/)[1]
.
Comment on
Re: Avoiding if/else knots II
Select
or
Download
Code
In Section
Seekers of Perl Wisdom