http://www.perlmonks.org?node_id=627889


in reply to Strage result using localtime to convert epoch time

I cannot duplicate your output. Is there more to the code you're not showing us? When I run it, I see the following:

$ perl 627886.pl <br>mtime = 1178489994 <br>54, 19, 15, 6, 4, 107, 0, 125, 1

Update: ah, I can indeed reproduce your output if I add use Time::localtime; to the code. Now I get:

$ perl 627886.pl <br>mtime = 1178489994 <br>Time::tm=ARRAY(0x81cce18), , , , , , , ,

I missed the Time::tm= bit the first time I saw your code. This module is overriding the localtime function and returning an object instead of the usual return values.