1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 my %colors = (
7 apple => 'red',
8 orange => 'orange',
9 lemon => 'yellow',
10 lime => 'green',
11 grape => 'purple'
12 );
13
14 my @fruit = keys %colors;
15 print "before: ", join(', ', @fruit), "\n";
16
17 #
18 # Auto-vivify
19 $colors{'plum'} = 'purple';
20
21 @fruit = keys %colors;
22 print "after: ", join(', ', @fruit), "\n";