I want to pass a hash to a function which prints out hash's content. My code does not work. Can anyone tell me what is wrong with it? Thanks a lot
#!/usr/bin/perl my %hs; $hs{"one"} = 1; $hs{"two"} = 2;
sub pr { my $ref = $_;
foreach $key (sort keys %ref)
{
print "$key = $ref{$key}"; }
}
pr(\%hs);
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>