in reply to Re^2: '100 elsif's vs hash of coderef's
in thread '100 elsif's vs hash of coderef's

For "real" code my handlers are generally member functions so the "factored out" bit has already happened, but the munging is required to avoid accidental or naughty access to other members of the object.

A sometimes benefit of munging is that several handlers can be provided for the same base name - an action method and a help string method for example, or a parser and an executor.

Premature optimization is the root of all job security
  • Comment on Re^3: '100 elsif's vs hash of coderef's

Replies are listed 'Best First'.
Re^4: '100 elsif's vs hash of coderef's
by AnomalousMonk (Archbishop) on Dec 11, 2015 at 08:35 UTC
    ... munging is required to avoid accidental or naughty access to other members of the object. [Or] several handlers can be provided for the same base name - an action method and a help string method for example ...

    An interesting approach.


    Give a man a fish:  <%-{-{-{-<