in reply to Re: spliting a lengthy text
in thread splitting and coloring
print join ' ', unpack '(a10)*', "$_\n" for unpack '(a50)*', $str;
update A regex solution based on your plan of attack (if only because (un)?pack still scares me :)print "" . join ' ', unpack '(a10)*', $_ . "\n" for unpack '(a50)*', $ +str;
for ($str =~ /.{1,50}/g) {print join " ", /.{1,10}/g; print "\n"}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: spliting a lengthy text
by BrowserUk (Patriarch) on Nov 27, 2006 at 11:02 UTC | |
by grinder (Bishop) on Nov 27, 2006 at 14:17 UTC |