in reply to Date in filename

If you are worried about uniqueness in the filename, you are probably better of using the UNIX timestamp.
$file = time() . "whatever.ext";
The time function returns the UNIX time in seconds since the epoch. Using this method also prevents spaces from being in the filename that would be there if you used localtime.

Might want to take a look at perlfunc.

Amel - f.k.a. - kel

Replies are listed 'Best First'.
Re: Re: Date in filename
by alfie (Pilgrim) on Jul 25, 2001 at 17:19 UTC
    If you are really searching for a uniqe filename, you should quite propably add $$ (the process-ID) to it, to be on the save side. So you can have multiple programs running at the same time that do not interfere:
    $file = time()."-$$.tmp";
    HTH!
    --
    use signature; signature(" So long\nAlfie");
Re: Re: Date in filename
by Anonymous Monk on Jul 25, 2001 at 17:06 UTC
    Thanks Amel. This is actually better than what I wanted. I'm gonna use it!