Actually, I do use CGI::Application. And I have used hashes as dispatch tables before (actually reinvented that wheel myself after dipping my toe in some assembly code). I usually use switch type statements for combining regex tests and other kinds of comparisons/tests (like in the example). I was not aware of Tie::Hash::Regex however. That is something I will rtfm on. CPAN is so massive I find it hard to keep up with it all (and that is a good thing).
UPDATE:Tie::RegexpHash also seems like a pertinent module to check out. It allows one to use regexes as hash keys.
In reply to Re: Re: What is the most efficient perl switch/case statement?
by synistar
in thread What is the most efficient perl switch/case statement?
by synistar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |