Peter. I was curious whether srftime offers any particular speed advantage so I took the code you posted, fixed a couple of typos and finished the months array and then use Time::HiRes to compare.
HJP Sun, 06 May 2007 20:09:05 -0400
SYS Sun, 06 May 2007 20:09:05 -0400
HJP ELAPSED 2.948317 - 100000 iterations
SYS ELAPSED 1.223327 - 100000 iterations
Not really worth fussing about.
Rather than caching the result, you can just use a BEGIN { } block
to test strftime. Unless someone modifies the shared library while the
daemon runs, that should be safe enough.
I've attached the working version.
--gh
hjp_test
Description: Perl program
