Re: nested each(%hash) question

2001-05-08 Thread Timothy Kimball
: > I have 2 hashes, %one and %two. : > : > the ($key, $value) of %one is a span of time. : > : > I need to compare this span of time over every $key of %two. : : ... : : Look at the replies given here earlier. : I ran some benchmarks with while and grep, and your while loop didnt look : less e

Re: nested each(%hash) question

2001-05-08 Thread M.W. Koskamp
> I have 2 hashes, %one and %two. > > the ($key, $value) of %one is a span of time. > > I need to compare this span of time over every $key of %two. > > Here's what I have: > > while (($key1, $val1) = each (%one)) { > > while (($key2, $val2) = each (%two)) { > > if (($key2 >= $key1) && ($key2 <

Re: nested each(%hash) question

2001-05-08 Thread Timothy Kimball
: I have 2 hashes, %one and %two. : : the ($key, $value) of %one is a span of time. : : I need to compare this span of time over every $key of %two. : : Here's what I have: : : while (($key1, $val1) = each (%one)) { : : while (($key2, $val2) = each (%two)) { : : if (($ke

nested each(%hash) question

2001-05-08 Thread Jim Conte
I have 2 hashes, %one and %two. the ($key, $value) of %one is a span of time. I need to compare this span of time over every $key of %two. Here's what I have: while (($key1, $val1) = each (%one)) { while (($key2, $val2) = each (%two)) { if (($key2 >= $key1) && ($key2

Re: nested each(%hash) question

2001-05-05 Thread Me
[given a set of ranges, find items that are in range. one way is for each range, look at each item. runtime is proportional to sizes: range set X item set if this is too slow, what is a faster way?] *Design notes* If theory bores you, skip to *Implementation notes*. 1. Changing when you comp

Re: nested each(%hash) question

2001-05-05 Thread Jeff Pinyan
On May 5, Jim Conte said: >the ($key, $value) of %one is a span of time. > >I need to compare this span of time over every $key of %two. > >while (($key1, $val1) = each (%one)) { > > while (($key2, $val2) = each (%two)) { > > if (($key2 >= $key1) && ($key2 < $val1)) { >

nested each(%hash) question

2001-05-05 Thread Jim Conte
I have 2 hashes, %one and %two. the ($key, $value) of %one is a span of time. I need to compare this span of time over every $key of %two. Here's what I have: while (($key1, $val1) = each (%one)) { while (($key2, $val2) = each (%two)) { if (($key2 >= $key1) && ($key2