my %functions = ( net => sub { ... }; type => sub { ... }; ); my %input_values = (net => 1, type => 2); my %cmp_values = (net => 1, type => 3); my @keys = qw/net type/; foreach my $key (@keys) { my $curval = $input_values{$key}; if ($curval == $cmp_values{$key}) { &{$functions{$key}}($curval); } }
Igor 'izut' Sutton
your code, your rules.
In reply to Re: Better way of matching
by izut
in thread Better way of matching
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |