in reply to accumulating rex-exp matches in an array
while (<INFILE>) { while (s/(AAA\.\d)/xxxxx/) { push (@list, $1); } } [download]
while (<DATA>) { push (@foo, grep /AAA\.\d/, split(/\s*,\s*/)); } [download]