programming-examples/perl/Hash/Obtain the list of keys and display each key-value pair.pl
2019-11-15 12:59:38 +01:00

12 lines
251 B
Raku

%presidents = ( George => "A",
Abe => "B",
Thomas => "C",
Harry => "D" );
@keys = keys( %presidents );
while ( $key = pop( @keys ) ) {
print "$key => $presidents{ $key }\n";
}