From: Mmcolli00 Mom Date: 2009-07-24T00:42:49+09:00 Subject: Dir.entries, output showing nils When I output to line for RegisteredUser it shows all filenames as nil for all but the files. What can I change to show only the filename meeting the conditions? Thanks, MC outputs.... nil nil nil nil AUR123443.txt Dir.entries(ascpath).each do |filename| if filename =~ /^AU/ then if filename[2..2] == "R" then RegisteredUser = filename else NonRegisteredUser = filename end end #below shows nil for all files and then shows the registereduser file. puts RegisteredUser end -- Posted via http://www.ruby-forum.com/.