Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Counting instances of a string in certain sections of files within a hash

by Maire (Scribe)
on Nov 01, 2017 at 10:26 UTC ( [id://1202507]=note: print w/replies, xml ) Need Help??


in reply to Re: Counting instances of a string in certain sections of files within a hash
in thread Counting instances of a string in certain sections of files within a hash

Wow, thank you so much for all of this and especially for your very clear explanations of the changes/improvements that you have made to the original script.

Your assumptions that the data is the same as that from our previous discussion and also that I will be performing numerous tasks using this data are correct. I've now implemented the "return \%corpus;" change across the scripts that use that function, thanks!

Unfortunately, I haven't yet been able to get this improved script to produce any output when I change the hash from the example one to the hash created by my getCorpus function. However, as I speculated in my reply to hippo above, I suspect that this may be something to do with the function itself. I'm going to run a few tests on small folders of data, to see if I can spot the exact problem.

Thanks again for all of this!

UPDATE: Ah, the script wasn't producing any output with my function because I was using incorrect syntax to print! I've now got output but, unfortunately, the count values are still lower than they should be. Interestingly, however, they are reporting the same frequencies as the version of this script that hippo helped me with:

{ "2017-09-04" => 1 } not ok 1 - 2017-09-04 tally correct # Failed test '2017-09-04 tally correct' # at C:\Users\lisad\PhD\perl\test11.pl line 62. # got: '1' # expected: '3' not ok 2 - 2017-09-30 tally correct # Failed test '2017-09-30 tally correct' # at C:\Users\lisad\PhD\perl\test11.pl line 63. # got: undef # expected: '2' # Looks like you failed 2 tests of 2.

  • Comment on Re^2: Counting instances of a string in certain sections of files within a hash
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1202507]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-19 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found