![]() |
|
more useful options | |
PerlMonks |
Re^3: Word Count and Matchby davido (Cardinal) |
on Jan 07, 2021 at 22:50 UTC ( #11126575=note: print w/replies, xml ) | Need Help?? |
Your sample code is not a short self-contained snippet that demonstrates the behavior you describe. Your data is not part of the code, and the code that is relevant is incorporated in a subroutine that your example never calls, and it has external dependencies that aren't needed, and that aren't loaded by the snippet. That means anyone wanting to respond to help you has to refactor the code so that it can run stand-alone, and in doing that, anyone trying to help you might inadvertently fix the thing that you're describing as working incorrectly. Precision in these sorts of things is important. We shouldn't be chasing you down to demonstrate the actual bug to us in a way that we can repeat in our own tests. I took a stab at doing this; I pulled the data into a __DATA__ segment, removed the need for external files, and caused your output to print entirely to STDOUT, but preserved in the output the names of the handles you were printing to. I also removed the colorization, since it is an external dependency that you didn't "use" in your snippet. So I assume it's not part of the problem. Additionally, I added the formatting back in that I needed to be able to understand your code. Having done all that stuff that you should have done, this is what I came up with:
And when I run that I get:
Which, to me, is an indication that the code is behaving as designed, and that you are NOT getting some summary count at the end like you said you are getting. At least not from the code you provided. So where are we now? You've asked a question, people said that the original question didn't demonstrate the problem being described. You took a stab at providing a better example of the code, but still failed to demonstrate that there is actually a problem with the code you posted. If I had to guess, I would say you have a print statement somewhere that you have forgotten about. Either way, people who are just trying to help had their willingness to help squandered. Dave
In Section
Seekers of Perl Wisdom
|
|