Now gives a report with the correct numbers

Before I was using length rather than scalar to look at how
many entries were in each hash and how long the arrays were
but that can only be used in the case of strings.

Here you must use scalar to get lengths. Correction made,
script now works as expected.