while($k>2){ $k=$k-1; print "$k\n"; } #and while($k>=2){ $k=$k-1; #last if $k==1; print "$k\n"; }