in reply to Programmatic creation of iterated string

I think what you're looking for is something like this:
my $x=''; for(1..9){ $x.="\n" if $_%3==1; $x.= $_.' '; }
I'm not really sure because there are many diffrent ways to generate the single example of the pattern you are looking for. Can you describe the pattern you want instead of giving a single example?