while (my $entry = match('a')) { print "- $entry\n"; # prints the correct results }