Each function: : each « Hash « Perl
- Perl
- Hash
- each
Each function:
#!/usr/local/bin/perl -w
my %cities = ("Toronto" => "East", "Calgary" => "Central", "Vancouver" => 'West');
while ( ($key, $value) = each %cities )
{
print "Key: $key Value: $value \n";
}
Related examples in the same category