for ( my $i=0; # start with this value of $i $i <=$#sorted; # loop while $i <= $#sorted(the last index in @sorted) $i++ # increase $i by one after each iteration ) { print "$sorted[$i]\n"; # print element number $i }