programming-examples/perl/Hash/Store color value in a hash.pl

16 lines
334 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl -w
use strict;
my %colors = (
red => '#FF0000',
green => '#00FF00',
blue => '#0000FF',
white => '#FFFFFF',
black => '#000000',
purple => '#520063'
);
print "Red is: $colors{red}\n";
print "Blue is: $colors{blue}\n";
print "Purple is: $colors{purple}\n";