while () { my $templine = $_; while (length $templine > 60) { my $substring = substr ($templine, 0, 60); print "$substring\n"; $templine = substr ($templine, 61); } print "$templine\n"; }