in reply to joining two variables and printing them to a file?

In line 21 you explicitly print a newline after each array element.

You will get better use out of POSIX::strftime and perl's builtin localtime. Shelling out twice to system date to get the time in completely unnecessary.

$ perl -MPOSIX=strftime -e'print strftime "%H:%M\n", localtime' 01:47 $
POSIX::strftime() is like sprintf specialized for time structures.

After Compline,
Zaxo