in reply to Re: Complex dispatch table
in thread Complex dispatch table
I chose this way of doing it (as far as I remember) because it was easier to read a list of method names/patterns from an external (plugin) module and add them to my Hash at the time. I'm not quite sure how that would work using anonymous subroutines, and if its not more dangerous creating them with eval..
(Maybe I should post how I do that at the moment..)
If someone types 'logic' then it does nothing at all.. thats why I compare the length of the command to $data, *and* then compare the pattern. As the pattern has 'log<space>' in it, it won't match.
Using compiled regexs sounds like an idea, if they're faster, I've not used qr// yet, so I'll have to look that up.
Also grouping the types of commands was something I'd thought of, but didn't get around to trying out yet :)
(P::RD is a tad too slow for mud triggers.. :)
C.
|
|---|