S
Slickuser
my %data = (
"name" => "BOB",
"age" => 35,
"sex" => "M",
"phone" => "555-5555",
"city" => "LA",
"state" => "CA",
"country" => "US"
);
foreach my $entry (keys %data)
{
print $entry ." ". $data{$entry} ."\n";
##can't use sort keys or values
}
If I got my hash array like this.
How can loop through in the order of name, age, sex, phone, city,
state, country?
"name" => "BOB",
"age" => 35,
"sex" => "M",
"phone" => "555-5555",
"city" => "LA",
"state" => "CA",
"country" => "US"
);
foreach my $entry (keys %data)
{
print $entry ." ". $data{$entry} ."\n";
##can't use sort keys or values
}
If I got my hash array like this.
How can loop through in the order of name, age, sex, phone, city,
state, country?