Help for this page

Select Code to Download


  1. or download this
    my @unsortedArray;
    foreach my $received_xml_post (@ {$xml_post_array{'data'}})
    ...
    
    my @sortedArray = sort { $a->{RouteDistance} <=> $b->{RouteDistance ||
    + $a->{Distance} <=> $b->{Distance} } @unsortedArray;
    
  2. or download this
    my @unsortedArray;
    foreach my $received_xml_post (@ {$xml_post_array{'data'}})
    ...
    }
    
    my @sortedArray = sort { if( $a->{RouteDistance} == 0) {return -1} els
    +e {$a->{RouteDistance} <=> $b->{RouteDistance} $a->{Distance} <=> $b-
    +>{Distance} } @unsortedArray;
    
  3. or download this
    sort {
        $a->{routedistance} && $b->{routedistance} 
        ? $a->{routedistance} <=> $b->{routedistance}
        : $a->{distance} <=> $b->{distance}
    } @ar;
    
  4. or download this
    #!/usr/bin/perl
    use warnings;
    ...
        print "ID: ".$sorted_row->{'ID'}." Distance: ".$sorted_row->{'Dist
    +ance'}." RouteDistance: ".$sorted_row->{'RouteDistance'}."\n";
    }