Re: Accessing the values of HoH
- From: mumia.w.18.spam+nospam@xxxxxxxxxxxxx ("Mumia W.")
- Date: Fri, 29 Dec 2006 04:46:12 -0600
On 12/29/2006 12:22 AM, M. Lewis wrote:
[...]
I thought I'd prefer to have it listed more like this:
jelly -- strawberry
apple
grape
pear
[...]
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";
}
[...]
I advise against changing the original keys. The variable $" determines what string is used to separate array elements expanded within a quoted string (read "perldoc perlvar"). I would set $" to "\t\n" before printing.
Good luck.
.
- References:
- Accessing the values of HoH
- From: "M. Lewis"
- Accessing the values of HoH
- Prev by Date: Re: Determine script full path.
- Next by Date: Re: Determine script full path.
- Previous by thread: Re: Accessing the values of HoH
- Next by thread: Determine script full path.
- Index(es):
Relevant Pages
|