#!/usr/bin/perl -wl use strict; my $str = "School of Wisdom and Knowledge College Preparatory"; my $pos = 0; $pos = 1 + index $str, " ", $pos for 1..4; substr $str, $pos -1, 1, "\n" if $pos; print $str;