in reply to Maintainable and robust Pattern Matching with changing goalposts

It looks like you could take advantage of dispatch tables.
my %header_handlers = ( Device => \&process_device, Type => \&process_type, ... ); ... my $handler = $header_handlers{$header}; &{$handler}($ref) if defined $handler;
  • Comment on Re: Maintainable and robust Pattern Matching with changing goalposts
  • Download Code

Replies are listed 'Best First'.
Re^2: Maintainable and robust Pattern Matching with changing goalposts
by McDarren (Abbot) on Sep 19, 2005 at 07:43 UTC
    Thanks [id://ikegami] :)

    I sort of get the gist of what you are saying, although this is a completely new concept to me.
    Just did a quick google on "Perl dispatch tables" and discovered that the topic is covered in Higher Order Perl by [id://dominus].

    Now I have a good reason to get a copy.
    (Although I also note that it will be available online soon :)