Your code doesn't compile as it stands. Please paste code into your posts, don't try to retype it as you _will_ make mistakes.
There are a number of errors here, but I don't know how to fix them as I don't understand what you are trying to do. Your code that increments the values never gets called. Let's trace thru the first iteration of the loop to see why...
The first value that $k gets is 'M01.001'. That is then reversed and put into $temp, so $temp contains '100.10M'. Then your substitution removed the first few characters so $temp contains '10M'. You reverse that and store it in $t, so $t contains 'M01'. You then look for $hash{$t}. But %hash doesn't have a key with the value 'M01', so your "if" condition fails and the increment statement is never executed.
Does that help?
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: Incrementing a hash of array value
by davorg
in thread Incrementing a hash of array value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |