On Sat, 2 Jun 2001 12:26:20 -0400, David Gilden said:
> Also I am creating unique files and was thinking of the following:
>
> $unique_file_name 'fourm'. (localtime) . '.html';
>
> is there a better way of doing this, I am saving each entry froma web based guest
>book as
> a separate .html file. So if the same person submits another entry, I don't want
>that
> to overwrite any older files, so I can't use their name for the file name with out
>some sort of
> 'key'... any comments.
You can use the File::Temp module and do:
use File::Temp qw/tempfile/;
..
($fh, $filename) = tempfile("forum.XXXXX", SUFFIX => '.html', CLEANUP => 0, DIR
=> '/bla/mydir');
then you can use the $fh as usual:
print $fh <<EOF;
<HTML>
<!-- put anything here -->
</HTML>
EOF
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com