Getting All of the Keys
-
Similar to the values function, Perl provides a keys
function to get all of the keys.
@array = keys(%hash);
-
Assigns each key of the hash to the array.
@names = keys(%studentData);
-
And, now that you have an array, you can loop through each item and do
with it what you want.
Why stop there?
Home