I was using a hash to accumulate occurrences of a string (jobnames) in the file and I tried to use ++ to auto increment; but it didn't work. Since TMTOWTDI, I found an easy solution but I'm just curious as to why this doesn't work. Shouldn't the value of key 'A' be 2?; why doesn't ++ work or what did I do wrong? TIA Paula
_SNIPPET_ use strict; my %hash; $hash{'A'} = '0'; #why doesn't this work... $hash{'A'} = $hash{'A'}++; #isn't it logically equivalent to this? $hash{'A'} = $hash{'A'}+1; print "VALUE of A:$hash{'A'}\n"; _END SNIPPET_ _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs