- or download this
## your code is effectively this:
my %hash_list = ( " Bill 34", " Jane 28", " John 20", " Tom 19", "
+Wall 18" );
...
" John 20" => " Tom 19",
" Wall 18 => undef
);
- or download this
print sort ( split( /,/, $names ) );
- or download this
my $names = "John 20, Bill 34... etc";
my @elems = split( /\s*,\s*/, $names );
...
my @sorted = map{ $num2name{$_} } sort { $a <=> $b } keys %num2n
+ame;
print "@sorted\n";