in reply to splitting a string into arbitrary lengths
There's nothing wrong with what you're doing; anything else is likely to simply be obfuscation.
If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.
That way everyone learns.
In Section
Seekers of Perl Wisdom