use warnings; use strict; my $path = '/var/log/*'; my @files = grep { -f } glob $path;