![]() |
|
laziness, impatience, and hubris | |
PerlMonks |
Re: Implementing Dispatch Tablesby deMize (Monk) |
on Jul 31, 2012 at 13:41 UTC ( #984599=note: print w/replies, xml ) | Need Help?? |
This is an old post, but regarding your snippet ($disp_table{'not there'} || sub {})->(); why not do something like $disp_table{$some_key}->() if $some_key;? It shouldn't error out for using an empty string. If your key is falsy (0 or undef), then it won't look it up. Demize
In Section
Tutorials
|
|