in reply to Date function

You should probably use one of the existing date modules, but if you want to do it yourself, take a look at a possible simple solution in this session under the perl debugger:

DB<8> $c = time DB<9> p $c 1375466025 DB<10> $c -= 3600*24 DB<11> $d = localtime $c DB<12> p $d Thu Aug 1 19:53:45 2013

which is exactly one day ago in my local time zone.