\#!/usr/bin/perl my $par = "Call me a joker call me a fool. Right at this moment Im totally cool. Clear as a crystal, sharp as a knife. I feel like Im in the prime of my life. Sometimes it feels like I'm going to fast. I dont know how long this feeling will last. Maybe its only tomihgt."; my $text; # insert some new-lines to make text easier to read (my @words) = split /( )/,$par; my $char = 0; my $line_length = 36; foreach my $word (@words) { $char += length $word; if ($char > $line_length ) { $text .= "\n"; $char = length $word; $line_length = 60;} $text .= $word; } print $text,"\n";