Joseph Alotta wrote: >Greetings, > >I am having some conceptual problems doing what I think is a fairly >simple perl task. It is probably that my mind is just blank on >this. Could someone please recommend a strategy for this. > >I have a hash of data: > >%highest_level = ( 2001-10-14 => 152, 2002-01-15 => 163, 2003-03-13 => >210, 2004-08-07 => 307 ); > >And I am give some dates in between: > >@dates = ( 2001-12-30, 2002-03-19); > >I need to find what the highest level was on that date, matching >between known dates. This is the answer: > >%level = ( 2001-12-30 => 152, 2002-03-19 => 210); > > You mean like this?
for (@dates) { $level{$_} = $highest_level{$_}; } HTH, Jan -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>