my @in = grep { /\.txt$/ } readdir IN; # read all file names form dir except names started with dot