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