or download this
my @action_tree = ( { test => sub { $_[0] >= 300 && $_[0] <= 400 },
action => sub { print "GUDNITES\n"; CORE::exit(0
+) } },
{ test => sub { $_[0] >= 425 && $_[0] <= 500 },
...
{
$_->{test}->($signal) && $_->{action}->() for @action_tree;
}