Accessing the values of HoH
- From: cajun@xxxxxxxxxxxx ("M. Lewis")
- Date: Fri, 29 Dec 2006 01:22:06 -0500
In my most recent postings, I was dealing with first HoA and now HoH.
In my previous example code, I ended up with an output that looked something like this:
jelly -- strawberry apple grape pear
jam -- strawberry apple grape
milk -- plain strawberry chocolate
I thought I'd prefer to have it listed more like this:
jelly -- strawberry
apple
grape
pear
jam -- strawberry
apple
grape
milk -- plain
strawberry
chocolate
So in the following snippet, I tried to add a "\n" onto the value of the HoH.
for my $i ( keys %HoH ) {
%{$HoH{$i}} = join ("\n", %{$HoH{$i}}, "");
print "$i -- @{[ keys %{$HoH{$i}} ]}\n";
}
But now for an output, what I get is:
jelly -- strawberry
apple
grape
pear
jam -- strawberry
apple
grape
milk -- plain
strawberry
chocolate
This begs two questions:
1) am I correctly accessing the value of the HoH ?
2) where is the 'extra' "\n" coming from
Thanks,
Mike
--
Years of development: We finally got one to work.
01:10:01 up 14 days, 22:01, 0 users, load average: 0.51, 0.33, 0.22
Linux Registered User #241685 http://counter.li.org
.
- Follow-Ups:
- Re: Accessing the values of HoH
- From: "Mumia W."
- Re: Accessing the values of HoH
- From: "John W. Krahn"
- Re: Accessing the values of HoH
- Prev by Date: Re: HoA question
- Next by Date: Re: Fwd: click_button gives error on a existing button
- Previous by thread: HTML to DOC Converter
- Next by thread: Re: Accessing the values of HoH
- Index(es):