use strict; use warnings; my $line = ; # Quick and dirty # Greedily match anything from 1-70 characters my @lines = $line =~ /.{1,70}/g; print $_,"\n" for @lines; # Less memory use for large blocks of text while ($line =~ /(.{1,70})/g) { print $1,"\n"; } __DATA__ 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901