From: "Alex Harris" <[EMAIL PROTECTED]>
> $errlog = `date."MainDeploy.%m%d%y"`;
>
> why doesn't this work? It does in unix. Also what's the way I add a
> date to file name? I'd like to create the following convention.
> plantname.date.log
> Error.plant.date.log.
Do not shell out unless you really have to.
{
my ($mday,$mon,$year) = (localtime())[3,4,5];
$errlog = sprintf 'MainDeploy.%02d%02d%04d.log',
$mon+1, $mday, $year+1900;
}
But it would be much better to use YYYYMMDD than MMDDYYYY
(who the heck invented this twisted notation anyway?). It sorts
better.
{
my ($mday,$mon,$year) = (localtime())[3,4,5];
$errlog = sprintf 'MainDeploy.%04d%02d%02d.log',
$year+1900, $mon+1, $mday;
}
HTH, Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]