use Text::Wrap; $Text::Wrap::columns=10; print wrap "", "", "This is a long string and should be wrapped."; # prints # This is a # long # string # and # should be # wrapped.