Help for this page

Select Code to Download


  1. or download this
    my $n = 0;
    while ( $str1 =~ /(\S+\s+)(?=(\S+\s+\S+))/g ) {
       print "$t1$t2\n";
       ++$n;
    }
    
  2. or download this
    my @words = split ' ', $str;
    my $n = @words - 2;
    print "@words[$_+0, $_+1, $_+2]\n"
       for 0..$n-1;