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

The reason the compiler is insisting on the backslash is that you have prototyped the function to take three scalars. That enforces correct use when the code inside depends on dereferencing things.

After Compline,
Zaxo

Replies are listed 'Best First'.
(jeffa) Re: (prototypes) Re: why a
by jeffa (Bishop) on Jun 03, 2001 at 20:00 UTC
    That enforces correct use...

    but only if the function was called using the name(args) syntax - the compiler doesn't enforce the prototype when the & syntax is used, or if the sub is called via a reference:

    &process($path, %seen, %total); # won't complain my $sub = \&process; $sub->($path, %seen, %total); # won't complain

    Jeff

    R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
    L-L--L-L--L-L--L-L--L-L--L-L--L-L--