in reply to print join n times on a line
Typically for Perl, there are several ways of doing that. Here's one:
@a = 'a'..'z';; $s = join ',', @a;; $s =~ s[(,[^,]+){6}\K,][\n]g;; print $s;; a,b,c,d,e,f,g h,i,j,k,l,m,n o,p,q,r,s,t,u v,w,x,y,z
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: print join n times on a line
by GotToBTru (Prior) on Apr 12, 2011 at 14:49 UTC | |
by toolic (Bishop) on Apr 12, 2011 at 14:59 UTC | |
by BrowserUk (Patriarch) on Apr 12, 2011 at 15:02 UTC |