in reply to New and need help in cgi, perl

For starters I would recommen you check out CGI.pm on CPAN. its just briliant for producing HTML.

After that it all you need is a deterministic method of generating your filename. Check out localtime if youre interested in dates. If youre reading and writing files, make sure you spit out the last used filesequence somewhere (a config file perhaps). When it comes to generating the next file, you read in your config file, (last file counter) increment it, then apply it.