First, use strict and use warnings. It will save you a lot of headaches in the long run; you will have to declare all your variables (with my, probably)
Second, don't use a system call to get the date; use localtime() instead (see `perldoc -f localtime`).
Apart from that, I really don't see anything weird about your code. How are you testing it and how are you compiling it?