in reply to Re^3: Counting matches and removing duplicates
in thread Counting matches and removing duplicates

So instead of
print {$out} "$1\n" while $xml =~ /$regex/g;
, I would simply write

my @matches; push(@matches, $1);
and then continue with my code from entityStat.pl.

Is that right?

Replies are listed 'Best First'.
Re^5: Counting matches and removing duplicates
by hippo (Archbishop) on Nov 15, 2024 at 16:45 UTC

    Yes, but you will need the same loop. ie.

    my @matches; push @matches, $1 while $xml =~ /$regex/g;

    🦛