You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
402 B
32 lines
402 B
#!/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__
|