There's really not much detail to be given. Currently you iterate over one file, store all elements in a hash, and later on you iterate over all the data in the hash.
Unless you need the hash for weeding out duplicates, you simply iterate over the data that you would have put into th hash when you need it.
Perl 6 - links to (nearly) everything that is Perl 6.