if (my @match = /$regex/o) { # ... Use $match[0] through $match[20] }