$s = "I want to only show the first 100 characters or so of a string that has more than 100, but I don't want to split it in the middle of a word, so is there a way to do it instead of this:";; print $string =~ m[(^.{0,100})\s];; I want to only show the first 100 characters or so of a string that has more than 100, but I don't print $s =~ m[(^.{0,$_})\s] for 20 .. 50;; I want to only show I want to only show I want to only show I want to only show the I want to only show the I want to only show the I want to only show the I want to only show the I want to only show the I want to only show the first I want to only show the first I want to only show the first I want to only show the first I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 characters I want to only show the first 100 characters I want to only show the first 100 characters I want to only show the first 100 characters or I want to only show the first 100 characters or I want to only show the first 100 characters or I want to only show the first 100 characters or so