Consider the following program code
%hash = ("small" -> "Boz",
"medium" => "16oz",
"large" => "32oz");
@keys = sort(keys(%hash));
for ($i = 0; $i < 3; $i++) {
print("$hash{$keys[$i]}\n");
}
What is the result of executing this program code?
- The code will fail at line 1 because a hash cannot contain both numeric and string data.
- The code will execute without error but will output nothing.
- The will output the following 32oz 16oz 8oz
- The code will output the following large medium small
Reveal Solution Next Question