reisinge has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks, I have a HoH called %lists that looks like:
I supposed that to modify the list (the hash's key), this should work:$VAR1 = { 'outdoor' => { 'cat' => 'other', 'desc' => 'Outdoor activities' }, 'Testlist' => { 'cat' => 'other', 'desc' => '' }, }
The desc changes ok, but the list doesn't change. Why is that?for my $list ( keys %lists ) { $lists{$list}{desc} = check_desc $lists{$list}{desc}; $list = "[mailto:$list\@example.com $list]"; }
Well done is better than well said. -- Benjamin Franklin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Modifying hash keys via the control variable
by choroba (Cardinal) on Dec 16, 2013 at 14:06 UTC | |
|
Re: Modifying hash keys via the control variable
by LanX (Saint) on Dec 16, 2013 at 14:05 UTC | |
|
Re: Modifying hash keys via the control variable
by NetWallah (Canon) on Dec 16, 2013 at 15:03 UTC |