in reply to why is a "\" needed before a hash in my subroutine call?

The backslash creates a reference to the hash, rather than passing the actual hash. This is useful to separate two hashes that you are passing at the same time -- and is also recommendable for arrays.

If you pass two arrays to a subroutine without making references, what the subroutine actually sees is one big array combining the two, and your subroutine would have to "know" how to split them apart. The same would apply with hashes.

Since you've passed them as references, they will be scalar variables when they arrive at the subroutine, and you will have to de-reference them with the % or @ funny symbol.

process($path, \%seen, \%total); sub process { my ($path, $seen, $total) = @_; my %totalhash=%{$total}; ... }