my %punkt = ( x => $wert_x, y => $wert_y ); my @kurve = [ \%punkt, \%punkt ]; @kurve = sort { $kurve[$a]->{x} <=> $kurve[$b]->{x} }, @kurve;