my $line = "The quick brown fox jumps over the lazy dog.";
while ($line){
$line =~ s/["",]//ig; #[] means to get rid of
#print $line
$line = lc($line); #lc is lowercase
while ($line=~m/\b(\w+\s\w+)\b/ig){ #[^ ] means any character except spaces and newline #($line=~m/\b(\s\w+\s\w+)\b/ig)
my $word =$1;
print "$word\n";
$wordcount{$word} += 1;
}
last;
}
close(INPUT);
close(OUTPUT);
Desired out put will be: the quick, quick brown, brown fox, fox jumps.... However, for the code above I am only getting the quick, brown fox, jumps over....