use 5.14.0; use warnings; my @array = qw(1 4 3 6 2 5); say "Original: @array"; @array = ($array[3],$array[2],$array[0],$array[5],$array[1],$array[4]); say "Nach Vertauschung: @array"; @array = sort @array; say "Nach Sortierung: @array";