next if $line !~ /$patterns{$key}->{regex}/; my @captures = map {substr $line, $-[$_], $+[$_] - $-[$_] + 1} 1..$#-; #### my @captures = $line =~ /$patterns{$key}->{regex}/ or next;