Perl CGI.pm

my box is FreeBSD4.3 and I use Perl 5.0005_03.
Here is the CGI script.

test.cgi
......
if ($query->action eq 'detail') {
......
print $query->hidden('action', 'modify');
......
}

I found that the result of
test.cgi?action=detail
is not what I expected.

the script does not generate <INPUT TYPE="hidden" NAME="action" VALUE="modify">
it generates INPUT TYPE="hidden" NAME="action" VALUE="detail">
Can anyone tell me whether this is a bug in CGI.pm or I did not use it correctly.
thanks in advance.
-Tony

What output are you trying to achieve?

I want to make a script. If the action equals "detail" it display the detailed info of one record specified by id, and show up a button. If user presses the button if will send action=modify to it self and enable user to modify the record. The output is in html.

I think your "if" statement should be something like:

if $query->param('action') eq "detail"
...

Sorry, misspelling. It IS
if $query->param('action') eq 'detail'