$ml = 3; @a = "abcdefg" =~ /.{1,$ml}/g; say "@a"; __END__ abc def g
In reply to Re: chopping a string into slices - is there a more elegant way to do it?
by JavaFan
in thread chopping a string into slices - is there a more elegant way to do it?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |