foreach my $key (sort {lc($a) cmp lc($b)} keys %excel) { my($tab,$row,$col) = split(/-/, $key); if (($tab eq "Customers") && ($col eq "1") { }