#! perl -sw use strict; my @strings = map{"$_" x 200} 1 .. 3; while( length "@strings" > 2 ) { print substr( $strings[$_], 0, 60, '') . "\n" for 0 .. $#strings; print "\n"; } __END__ c:\test>213729 111111111111111111111111111111111111111111111111111111111111 222222222222222222222222222222222222222222222222222222222222 333333333333333333333333333333333333333333333333333333333333 111111111111111111111111111111111111111111111111111111111111 222222222222222222222222222222222222222222222222222222222222 333333333333333333333333333333333333333333333333333333333333 111111111111111111111111111111111111111111111111111111111111 222222222222222222222222222222222222222222222222222222222222 333333333333333333333333333333333333333333333333333333333333 11111111111111111111 22222222222222222222 33333333333333333333 c:\test> #### #! perl -sw use strict; my @strings = map{"$_" x 200} 1 .. 3; my ($total, $p) = (0, 0); do { $total = 0; print substr( $strings[$_], $p, 60 ) . "\n" for 0 .. $#strings; print "\n"; $p+=60; $total += length($_) - $p for @strings; } while( $total > 0 ); __END__