in reply to Re: Determine largest key in hash
in thread Determine largest key in hash
At every iteration I need to check to see if I have an "event trigger" in the hash. If I do, I need to print it. I can't do a simple hash because each iteration (of the counter) COULD have more than one event trigger.my $cnt = 0; while(1) { $cnt++; #print event trigger from hash }
So on our first iteration we'd get triggered that we found Shrek. Sweet! It works well because we only had the one event.my %hash = ( 1 => { 1 => "nothing", name => "Shrek", event => "I saw shrek!", }, 6 => { 1 => "nothing", name => "Donkey", event => "I saw the donkey!", 2 => "nothing", name => "Fiona", event => "I saw Fiona!" }, );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Determine largest key in hash
by MidLifeXis (Monsignor) on Oct 04, 2011 at 17:56 UTC | |
|
Re^3: Determine largest key in hash
by BrowserUk (Patriarch) on Oct 04, 2011 at 18:02 UTC |