in reply to Re^2: check for date and time
in thread check for date and time
#!/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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: check for date and time
by Anonymous Monk on Feb 26, 2010 at 11:11 UTC | |
by colwellj (Monk) on Feb 28, 2010 at 23:03 UTC |