Help for this page

Select Code to Download


  1. or download this
    sub trunc {
        @_ == 2 or return;
    ...
    
    my $str = "there once was a man from Nantucket who kept all his cash i
    +n a bucket";
    print trunc(5, $str), "\n";
    
  2. or download this
    /((?:[^\w\s]*\w+[^\w\s]*\s*){1,$max_words})/