- or download this
$class = '...';
$color = color_of($class);
...
my $t = first { $class =~ /$_->{'re'}/ } @rules;
return $color->{'color'};
}
- or download this
for my $foo (...) {
my $color = first { $class =~ /$_->{'re'}/ } @rules;
...
...
}
- or download this
my $color = ${first { $class =~ /$_->{'re'}/ } @rules}->{'color'};