my @test; push @test, { distance => "0.12", name => "Test1", isPaidLink => 0 }; push @test, { distance => "1.2", name => "Test1", isPaidLink => 1 }; push @test, { distance => "4", name => "Test1", isPaidLink => 1 }; push @test, { distance => "9.2", name => "Test1", isPaidLink => 0 }; push @test, { distance => "14", name => "Test1", isPaidLink => 1 }; my @loop_sorted = sort { $a->{Distance} <=> $b->{Distance} } @test;