You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
347 B
Perl
12 lines
347 B
Perl
use Switch;
|
|
|
|
print "What is your favorite color? ";
|
|
chomp($color=<STDIN>);
|
|
switch("$color"){
|
|
case "red" { print "Red!\n"; }
|
|
case "blue" { print "blues.\n"; }
|
|
case "green" { print "green\n";}
|
|
case "yellow" { print "yellow";}
|
|
else { print "$color is not in our list.\n";}
|
|
}
|
|
print "Execution continues here....\n"; |