Help for this page

Select Code to Download


  1. or download this
    if (length $word > 45) {
      my $forty_sixth = substr($word, 45, 1);
      $word = substr($word, 0, 45);
      $word =~ s/\s*\w*\z// if $forty_sixth =~ /\w/;
    }
    
  2. or download this
    if (length $word > 45) {
      my $forty_sixth = substr($word, 45, 1);
    ...
      $word =~ s/\w+\z// if $forty_sixth =~ /^\w/;
      $word =~ s/\s+\z//;
    }