in reply to Re^2: Is there an array for $1,$2,$3... or some alternative ?
in thread Is there an array for $1,$2,$3... or some alternative ?

When you think of a subset of an array, think grep.
Use map only when you think of transforming one thing into another.
Perl variables can be interpolated into a regex expression.
my $pat = "somepattern"; @simMatches = grep{/$pat$num/} @simMatches; # subset of @simMatches
Show a couple of lines of actual data and this can all become clear.
$1 or $2 are regex capture variables that don't seem to play a role here.