http://qs321.pair.com?node_id=177159


in reply to accumulating rex-exp matches in an array

while (<INFILE>) { while (s/(AAA\.\d)/xxxxx/) { push (@list, $1); } }
or if the items are always seperated by a space.
while (<DATA>) { push (@foo, grep /AAA\.\d/, split(/\s*,\s*/)); }