#! /usr/bin/perl -w use strict; use Time::ParseDate; my $days = shift; my $unixend = parsedate("now + $days days"); die "Usage: $0 days calendar-file" if not defined($unixend); while (<>) { chomp; (my $when) = split /[^0-9\/-]/; my $unixwhen = parsedate($when, UK => 1); last if $unixwhen > $unixend; print "$_\n"; }