my @arr; while () { push @arr, $1 if /^\$FILES(.*?)\$$/; }