in reply to Date Calculation

Of course, everyone is quick on the draw with Date::Calc, but I think you've already solved the problem yourself.
use POSIX 'strftime'; my $day = strftime("%j", localtime(time()));
You'll find that the date command and strftime have, not surprisingly, a lot in common.

The alternative is to access the appropriate entry in the localtime array, as suggested by Enlil.