This is what the code suggested: ...
I have downloaded the code properly.
You did not download the code properly. Like I already told you in Re^7: count the maximum no.of occurence, use the download code link to download the code
And here is the output for that:
Simply repeating what you already said is annoying, esp when other parts of what you are saying are obviously wrong.
Which perl are you using? I get the correct output using v5.12.2
A pattern containing a + inside a lookahead would sometimes cause an incorrect match failure in a global match (e.g., /(?=(\S+))/g)