my ($y,$m,$d) = (localtime)[5,4,3]; my $file = sprintf("errors.%04d-%02d-%02d", $y+1900, $m+1, $d); open ERRORS, '>>', $file;