--- Nic LAWRENCE <[EMAIL PROTECTED]> wrote:
> Is it possible to pass hashes between subroutines? When I try stuff
> like &foo(%bar); or return %bar; it doesn't seem to work how I would
> expect.
That will flatten the whole hash out to a list. You could receive it
like this:
sub foo {
my %h = @_;
# . . .
}
If you want to pass the actual *original* hash instead of a copy of the
key/value contents, use a reference like foo(\%bar) and receive it like
this:
sub foo {
my $h = @_;
for (keys %$h) { print }
$h->{X} = 'Y';
# etc.
}
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/