while ($eachfile = <*.txt>) { ... } #### @files = <*.txt>; foreach (@files) { ... } #### opendir(DIR, ...); while (defined ($eachfile = readdir(DIR) )) { next if not /\.txt$/; ... }
## @files = <*.txt>; foreach (@files) { ... } ##
## opendir(DIR, ...); while (defined ($eachfile = readdir(DIR) )) { next if not /\.txt$/; ... }