Hi Rouilj, Yes, that's how I solved it. I realized that I didn't use the '' around $3.
Thanks for your help, Rafael On Apr 11, 2011, at 10:24 AM, John P. Rouillard wrote: > > In message <b65ac34a-2379-494a-990e-58b0eb955...@gmail.com>, > Rafael Bonilla writes: >> Yes, I was missing an "=" when I wrote my email but not on my real script so >> the question still applies. >> >> Forget the real script's purpose for now, what I want to do is just print >> each pair of *key, value* from a perl hash using >> while (my ($key, $value) = each %%my_hash){ >> print ("Key: $key, Value: $value\n"); >> } >> >> The output I'm seeing is: >> Key: ??, Value: 1 >> Key: ??, Value: 5 >> Key: ??, Value: 3 >> ... >> >> All key values are incorrect (there should be IP addresses xxx.xxx.xxx.xxx). >> Instead, the code displays ??. >> >> It seems to me that the key values are not being stored correctly (is that >> even possible?) although I see on SEC debug messages that the key values are >> correct. > > Hmm, this sounds like you are somehow storing not the string form of > ip address but the address of the string or something else. > > From your initial email: > >> BTW: I'm counting the events using eval %o (++$my_hash{$3}); >> where $3 has the IP value that I need to record. > > maybe you need: > > eval %o (++$my_hash{'$3'}); > > to make sure that $3 is interpreted as a string? > > -- > -- rouilj > John Rouillard > =========================================================================== > My employers don't acknowledge my existence much less my opinions. ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Simple-evcorr-users mailing list Simple-evcorr-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users