in reply to Hash reference question

Usually, when you want a hashreference, you use the $ prototype. After all, a hash reference is a scalar. The prototypes \% and \@ are special. It means that a variable in that slot has to start with a % or a @, and that the hash or array will not be flattened out. You would use this to prototype functions with a similar behaviour as keys or push.

-- Abigail

Replies are listed 'Best First'.
RE: Re: Hash reference question
by Anonymous Monk on Jul 14, 2000 at 13:24 UTC
    The funny thing about the issue is that this worked OK:
    my %funny; foo(\%funny); sub foo(\%) { my $foo = shift; $foo->{"FOO"} = "BAR"; }
    If foo was from a module, it didn't work.. But thanks, now I know.