Help for this page

Select Code to Download


  1. or download this
    map{   # map is a way of building a loop
           # map returns a list of the resulting values.
    ...
    # again a map, taking the order array and pushing the
    # related values from the $a hash into @results
    # giving you the ordered numbers.
    
  2. or download this
    map{/(\S+)\s+(-?[\d.]+)/;$a{$1}=$2?$2:''}<DATA>;
    map{push(@result,defined $a{$_} ? $a{$_} : 999)}@order;