Created
February 23, 2013 16:29
-
-
Save adriaandens/5020340 to your computer and use it in GitHub Desktop.
Elective.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use warnings; | |
%courses = ( | |
"2CPR2B" => "C Language", | |
"1UNX1B" => "Intro to UNIX", | |
"3SH414" => "Shell Programming", | |
"4PL400" => "Perl Programming" | |
); | |
#Sorteren op key values: | |
foreach $key (sort keys %courses) { | |
print "$key: $courses{$key}\n"; | |
} | |
print "\nEnter the code for the course you wish to follow."; | |
chomp($yourCourse = <STDIN>); | |
while(($key,$value) = each(%courses)) { | |
if($key eq $yourCourse) { | |
print "You will be taking $value this semester."; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment