in reply to Dividing up Long Lines

Text::Wrap might come in handy:
use warnings; use strict; use Data::Dumper; use Text::Wrap; $Text::Wrap::columns = 30; my $col = 'very long string right here ya know'; my @cols = split /\n/, wrap('', '', $col); print Dumper(\@cols); __END__ $VAR1 = [ 'very long string right here', 'ya know' ];
It depends if your address 2 can be 60 or longer, or if it is 30 or more but has no spaces. Otherwise, these may help:

Replies are listed 'Best First'.
Re^2: Dividing up Long Lines
by Anonymous Monk on Jun 23, 2012 at 09:39 UTC

    TheDamians Text::Autoformat is also interesting :)

    $ perl -MText::Autoformat -e " autoformat( {qw/ right 30 all 1 /})" - very long string right here ya know ^Z very long string right here ya know $ perl -MText::Autoformat -e " autoformat( {qw/ right 28 all 1 /})" - very long string right here ya know ^Z very long string right here ya know $ perl -MText::Autoformat -e " autoformat( {qw/ left 2 right 30 all 1 + /})" - very long string right here ya know ^Z very long string right here ya know $ perl -MText::Autoformat -e " autoformat( {qw/ left 2 right 30 all 1 + /})" - Address_Line_1 (this is never blank) Address_Line_2 (this could be blank) Address_Line_3 (this could be blank) Address_Line_4 (this is never blank) ^Z Address_Line_1 (this is never blank) Address_Line_2 (this could be blank) Address_Line_3 (this could be blank) Address_Line_4 (this is never blank)

    As is Perl6::Form

    $ perl -MPerl6::Form -ne " print form q{{[[[{ 30 }[[[[}} , $_" - very long string right here ya know very long string right here ya know ^Z