my @filters = ( ( map { my $re = qr/$_/; sub { $_[0] =~ $re } } @accept ), ( map { my $re = qr/$_/; sub { $_[0] !~ $re } } @reject ), );