If you are expecting the %columns to increase then you may want to add a print statement that says:
print "Discount == 1\n";
Then check to see if this is happening as often as you expect.
Note: If you are not going to use the value of the hash, you could save time by setting it to undef as in
$columns{$key_num} = undef;
And if you are going to do that, you might as well use an array instead of a hash, but there is probably something else you are using it for.
I hope this explains what is going on.
Cheers L~R
Update: Modified entire reply as I realized the problem is probably with the outside loop
In reply to Re: Hash key counting
by Limbic~Region
in thread Hash key counting
by blackjudas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |