you could make your life about 93.7% easier by using OO with this.

I was recently talking to demerphq about a module i had written that abstracted a dispatch mechanism, leaving your code as
package my::Class; use Dispatch ( doStuff => \&yadda, doMore => sub{ ... } ); # ...your methods here

Ive been too distracted with other stuff to hack it into shape for a meditation, but if you'd like to take a look at it so far, it may be of interest?
It experimentally supports self-loading and Object composition (plugins?) - though I would definitely appreciate some knowledgable feedback on my implementation, from the more experienced monks.

Like i say, this is half-formed, but feel free to play around with it...and of course, suggestions/criticisms are welcome.

hope it inspires something


time was, I could move my arms like a bird and...

In reply to Re: Complex dispatch table by Ctrl-z
in thread Complex dispatch table by castaway

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.