Help for this page

Select Code to Download


  1. or download this
    my @records; # Declare an array to hold records from the input file.
    {            # Start a new lexical block to limit the scope
    ...
        close IN; # Close the infile, we're done with it.
    }            # Close the lexical block that constrains the
                 # effects of the "local $/ = ....." definition.
    
  2. or download this
    my @sorted_recs = map { $_->[0] } 
        # This first map executes last, after the sort is done.
    ...
        # The second element contains only the floating point
        # number you're trying to sort on.
                      @records;