Subject: | Pass only some tags |
I'm wanting to pass only certain attributes to the parent hash, and I
can do that longhand, but I'd like a shortcut. I have a patch to go
after all the other 'pass ...' rules, not sure if the syntax should just
be 'pass tag1,tag2' or 'pass attr tag1,tag2'. Here's code that does the
former syntax:
} elsif ($rule =~ /^pass\s+(\S+)$/) {
my $tags = $1;
@results = map { $_ => $data->{$_} } split /,/, $tags;
Although the latter syntax might be better in case there's a tag named
'trim', in which case:
} elsif ($rule =~ /^pass\s+attrs?\s+(\S+)$/) {
my $tags = $1;
@results = map { $_ => $data->{$_} } split /,/, $tags;