in reply to Help with stdout.... in perl..

For date formatting, maybe save yourself some trouble and just use the DateTime module, specifically the strftime() method.