in reply to why is a "\" needed before a hash in my subroutine call?
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}; ... }
|
|---|