At 2:01 pm -0600 16/2/04, Joseph Alotta wrote:


Am I missing something or is this harder than it first appears?

I think you need either to quote the date string as below or use a number for the date, such as 20011014. If you use a number then you'll need to repalce ge, le with >=, <= respectively. Then I guess something like this is what you're after:


my %highest_level = (
 '2001-10-14' => 152,
 '2002-01-15' => 163,
 '2003-03-13' => 210,
 '2004-08-07' => 307
);
my @dates = ( '2001-12-30', '2002-03-19');

for $date (sort keys %highest_level) {
  if ($date ge $dates[0] and $date le $dates[1]) {
    print "$date: $highest_level{$date}$/";
  }
}

Reply via email to