#!/usr/local/bin/perl use GD; use Time::Local; $sys_time = time; $i = 0; for $file_time (@ARGV) { $file_time =~ s/\.gif$//; @times = split('_', $file_time); $times[1]--; $times[0] = '98'; $dif = ($sys_time - timelocal($times[5], $times[4], $times[3], $times[2], $times[1], $times[0])); $file_hash{$ARGV[$i]} = $dif; $i++; } for $key (sort { $file_hash{$a} <=> $file_hash{$b} } keys %file_hash) { if ($file_hash{$key} < 0) { next; } $winner = "$key.gif"; last; } open (IMAGE, $winner) || die "Can't open image! $!"; $my_image = newFromGif GD::Image(IMAGE) || die; @dim = $my_image -> getBounds(); $winner =~ s/\.gif$//; print "";