my @files = glob('*.*'); # or 'test.*' or '*.txt' for my $file (@files) { # ... }