in reply to counting unique elements of an array
Maybe you meant: my $count = scalar keys %count;
It appears to add the count from the last unique bankcode from the last file to the new files bankcode count
That sounds like a scoping issue. Are you using strict and warnings? You should be.
And it's impossible to tell what went wrong without seeing the whole of the loop. Including the places where the variables are defined for the first time.
BTW your map in void context looks a bit scary - your intention might be clearer if you used a for loop. If you like short code, you can also write @count{@bc} = undef; instead ;-)
|
|---|