for my $file (<$opts{d}/*.txt>) # use a file glob