in reply to building a hash with filname and itscontents
Others have answered your immediate question, but I'd like to point out a couple things you could improve: