I don't know how to explain this problem, so let's try with an example:
This minimal CGI script shows a page with two paragraphs and a small form that contains a dropdown menu, a textbox and two buttons. The textbox is for illustrative purposes only. After selecting a value from the dropdown menu and clicking the button "Set", the page reloads and the paragraphs show the new value selected, but the textbox stays with the same content (which I don't expect; I think it should change too). Similarly, clicking on "Add" changes the paragraphs but neither the textbox nor the dropdown menu reflect the new value.
In the real world, the dropdown menus are for selecting a date (the three typical year, month and day) and the "Add" button is "Go to the next day". I would like that the menus' default options turned into that of the next day (in order to be able to click more times) but, as shown, they stay the same.
I thought some kind of persistence of $q caused by mod_perl would be related but I just tried without it and the problem didn't go away.
my $q = CGI->new;
my $num = $q->param ('num') || 1;
my $button = $q->param ('go');
## increment $num if clicked in "Add"
$num++ if (defined $button and 'Set' ne $button);
"paragraph 1: num is [$num]",
$q->popup_menu (-name => 'num', -values => [1 .. 3], -default
$q->textfield (-name => 'foo', -value => "num is [$num]"),
$q->submit (-name => 'go', -value => 'Set'),
$q->submit (-name => 'go', -value => 'Add'),
"paragraph 2: num is [$num]",