in reply to Ignore this! Will repost later.

Why are you trying to turn "number of blocks in the file" into a timestamp? But even if you fixed that, are you sure you're not getting undef in $timestamp, because the stat failed? After all, this code can't even compile, so you aren't showing the actual code. How about showing the actual code?