while (<>) { # read a string from input my @senteces = split /\.\s+/; # ". " might work for splitting into sentences(?) for my $i ( 0 .. $#sentences ) { if ( $sentence[$i] =~ /(?