in reply to Is there a way to switch a hash values <> keys with a slice?
main::(-e:1): 0 DB<1> @h{ a..c } = 1..3 DB<2> x \%h 0 HASH(0x33c38e0) 'a' => 1 'b' => 2 'c' => 3 DB<3> %h2 = reverse %h DB<4> x \%h2 0 HASH(0x3554090) 1 => 'a' 2 => 'b' 3 => 'c' DB<5>
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there a way to switch a hash values <> keys with a slice?
by misterperl (Friar) on Apr 19, 2022 at 15:08 UTC | |
by LanX (Saint) on Apr 19, 2022 at 16:16 UTC |