my $str = "P H A G E P H A G E P Q K R E P H A G E P W S Q E P H A G E P R D L E P H A G E"; $str =~ s/\s+//g; my @words = $str =~ /.{1,5}/g;