#!/usr/bin/perl -w use strict; my %idhash; my @ids; foreach (@id_list){ #split up your input line into something useful @ids = split (/-->/,$_); # check to see if that date is already in your hash and if it is ne +wer if(defined($idhash{$ids[1]}) && $idhash{$ids[1]} >= $ids[2]){ next }else{ #populate your hash $idhash{$ids[1]} = $ids[2]; } } #then print your dates from the hash using foreach key
In reply to Re^3: check for date and time
by colwellj
in thread check for date and time
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |