Looks like you have been into the Perl Cookbook in chapter 3 and that you have been looking at page 71. The edition I have erroneously states that the range for $yday is 1-366 (but it's really 1-365). I think that the range for $sec is also wrong (0-60 vs 0-59).
Pay special attention to the $isdst variable. It's going to come in handy on October 28 when we "fall back".
$isdst is important if your machine is set to Universal Time and you are processing epoch seconds that are expressed in a US time zone (Eastern for example). If you are doing date math on a UT box but using EST or EDT, you need to examine $isdst to know how many seconds to subtract.
I have been bitten by this, but that's because I'm dumb.