while (<*txt>) { # process the file ($_ will contain the name of the file) }