%hash = (
"haneesh1" => "youngerson2",
"Nikil2" => "Elderson2",
"Purandaran3" => "youngerson1",
"hambi4" => "ederson1",
);
foreach (keys %hash) {
$line = $_;
$_ =~ s#\d+##gi;
$merge{$_} = $hash{$line};
}
@array1 = sort {uc $a cmp uc $b} (keys %merge);
foreach (@array1) {
push(@array2, $merge{$_});
}
$" = "\n";
print "@array2";
No comments:
Post a Comment