playing with hashes

cat-town
Dan Buch 14 years ago
parent afe4b10808
commit c4eaadf848

@ -0,0 +1,31 @@
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
my %petsounds = (
"cat" => "meow",
"dog" => "woof",
"snake" => "hiss"
);
print "The cat goes " . $petsounds{"cat"} . ".\n";
$petsounds{"mouse"} = "squeak!";
$petsounds{"dog"} = "arf!";
delete($petsounds{"cat"});
print "The mouse goes " . $petsounds{"mouse"} . ".\n";
print Dumper(\%petsounds) . "\n";
1;
__END__
Loading…
Cancel
Save