- my ($match_poll, $match_user, $match_choice) = $match =~ m/^id=(.*?) user=(.*?) choice=(.*?)$/;
- if (exists $polls->{$match_poll}) {
- my %poll = %{$polls->{$match_poll}};
+ my ($match_id, $match_user, $match_choice) = $match =~ m/^id=(.*?) user=(.*?) choice=(.*?)$/;
+ my $match_id_re = IkiWiki::glob2re($match_id?$match_id:'*');
+ my @polls = grep {$_ =~ $match_id_re} (keys %$polls);
+ return IkiWiki::FailReason->new("no poll match id=`$match_id'", $page => $IkiWiki::DEPEND_CONTENT)
+ unless @polls > 0;
+ foreach my $poll (@polls) {
+ my %poll = %{$polls->{$poll}};