in reply to why is a "\" needed before a hash in my subroutine call?
then you would (have to) call the function without putting a backslash before each hash:sub process ($\%\%) { my($path, $seen, $total) = @_; # do something... }
The calling code specifies a bare hash, but Perl still puts a references to the hash in @_.my %seen; my %total; foreach my $path (@ARGV) { process($path, %seen, %total); }
Personally, I prefer not to use prototypes; I would leave off the prototype definition and pass in explicit hash references.
|
|---|