Help for this page

Select Code to Download


  1. 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
       );
    
  2. or download this
       print sort ( split( /,/, $names ) );
    
  3. 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";