in reply to How do I extract named variable names from regex string
which seems just about cryptic enough, thenmap { s/>.*// } (my @items = split /\?</, $pat) ;
and pull out the keys with value bigger than 1 for duplicates.my %freq = () ; map { $freq{$_}++ } @items ;
I couldn't come up with a way to scan for duplicates all in one line, which is a little disappointing, but maybe there's something clever to do.
|
|---|