in reply to SIMPLE way to write these?

It is also worth mentioning that while can be used as a statement modifier.

$ perl -Mstrict -Mwarnings -E ' my $i = 1; say +( $i ++ ) while $i <= 10;' 1 2 3 4 5 6 7 8 9 10 $ perl -Mstrict -Mwarnings -E ' my $i = 1; say do { $i ++ } while $i <= 10;' 1 2 3 4 5 6 7 8 9 10 $

I hope this is helpful.

Cheers,

JohnGG