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:

  1. You should close all the handles you open, and at the earliest possible time.
  2. print Dumper [ %spr_hash ] would probably be better written as print Dumper \%spr_hash.

We're building the house of the future together.