for 1 .. 10 { .print; if $_ %% 5 { print "\n"; next; } print ', '; }
or without using a loop:
$_.join(", ").say for [1..5], [6..10];
Last updated 1 year ago