"my $MyIpAddrInfo = \%MIAI;" makes $MyIpAddrInfo a reference to the
%MIAI hash. That is why you can't print it directly.
If you want to treat $MyIpAddrInfo like the hash it refers to, you have
to dereference it by prefacing it with the '%' (see example below). The
brackets are usually optional, but some people like me just use them all
the time to avoid certain problems with more complicated data
structures.
my @keys = sort keys %{$MyIpAddrInfo};
You can also indirectly access the members of the hash by using the ->
operator, so:
$MyIpAddrInfo->{ip}
is the same as
${$MyIpAddrInfo}{ip}
is the same as
$MIAI{ip}
-----Original Message-----
From: FamiLink Admin [mailto:[EMAIL PROTECTED]
Sent: Saturday, October 01, 2005 3:04 PM
To: Wagner, David --- Senior Programmer Analyst --- WGO
Cc: [email protected]
Subject: Re: a little help...
David,
Thank you for your help! I am trying to get this to work. Can you tell
me
what my $MyIpAddrInfo = \%MIAI; does? I am getting
HASH(0x8133528)
for $MyIpAddrInfo if I print it out after the:
$MyIpAddrInfo->{$ip}++;
Ryan Lamberton
<snip>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>