The other posters have said mostly everything there is to say.
I would just like to point out that you might want to try DateTime that's available from CPAN. While localtime is a builtin, and therefore automatically available on all Perl installations everywhere, in my opinion it's a drag trying to remember the format of localtime. When it comes to dates and times, a good rule of thumb is that it's always better to use DateTime. So this means sure, you could waste some time learning localtime just for this time, and next time you need something more than showing a date you can learn DateTime. Or, you can go with DateTime right now and skip the intermediate step. Personally, I'd go with the latter.