Help for this page

Select Code to Download


  1. or download this
    [~] $ perl -wnle'/^((?:\S+\s+){1,30})/;print $1'
    one two three four five six seven
    one two three four five six
    
  2. or download this
    [~] $ perl -wnle'/^((?:\S+\s*){1,30})/;print $1'
    one two three four five six seven
    one two three four five six seven
    
  3. or download this
    [~] $ perl -wnle'@w=split/\s+/,$_,31;pop@w;print join " ",@w'
    one two three four five
    one two three four