use strict; use Time::Local; sub dayofyear { my ($d,$m,$y) = @_; $m--; (localtime(timelocal(0,0,0,$d,$m,$y)))[7] };