use warnings; use strict; my @emptyfiles = grep { /\d/ } grep { -f } glob '*';