http://www.perlmonks.org?node_id=716323


in reply to How to split a string into two lines, intelligently

If you just want to get it working (and are not specifically interested in the learning experience per se), you might want to consider using Text::Wrap :)