Sorry, it sounds like I needed to be more explicit.
%functions is a Tie::RegexpHash, so your suggestion of $functions{$regex}->($var2); is wrong — Use a normal has for that — and a step in the wrong direction. The key for lookups should not be a regexp, but a value to match against the existing keys.
Looping over all the keys is even worse. The whole point of Tie::RegexpHash is to save you from doing that.
In reply to Re^4: Using a regex as a hash key
by ikegami
in thread Using a regex as a hash key
by jivanm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |