in reply to Re^2: $tm = localtime;
in thread $tm = localtime;

I'm assuming use Strict is use strict in your program and that your are using Time::Piece in order for $tm = localtime to be an object that you can call $tm->mday, $tm->mon+1, etc.