There's More Perl to Write!
-
You can get both keys and values with the each function.
($key, $value) = each(%hash)
-
This returns the next key and value pair. Ideal for a loop.
-
What type of loop do we use when we want something
to execute while a condition is true?
while(($name, $age) = each(%studentData)) {
print "$name is $age years old.";
}
-
That's it!
Review/Lab
Home