in reply to CGI question: carrying information from CGI to CGI
<input type="hidden" name="id" value="$id"> Then, just get at it with:
my $id = $q->param("id") || new_id();
If you're not using CGI.pm, you probably should be.