Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
      ++$count;
    }
    ++$count if ($input =~ /./); # catch the last word
    
  2. or download this
    my @array = split /\s+/, $input;
    $count = scalar (@array);