You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
sub asc_sort_salary {
|
|
$salary{$a} <=> $salary{$b};
|
|
}
|
|
|
|
|
|
%salary = (
|
|
"P" => 10,
|
|
"S" => 12,
|
|
"C" => 5,
|
|
"S" => 6,
|
|
"L" => 11,
|
|
"D" => 8,
|
|
);
|
|
foreach $key (sort asc_sort_salary(keys(%salary))) {
|
|
printf "\t% -20s%5d\n", $key, $salary{$key};
|
|
}
|