in reply to 30 Spaces- 1 question

for ( 1..90) { $line .= "word "; } ( $thirty = $line ) =~ s/^((\w+\s){1,30}).*$/$1/; print $thirty;
That's my shoddy solution at any rate.