#!/usr/bin/perl use warnings; use strict; use CGI qw/ :standard /; print hidden( -name => "foo", -default => "bar", ), "\n"; #### > ./hidden.pl # the code above > ./hidden.pl foo=123 #### Note, that just like all the other form elements, the value of a hidden field is "sticky". If you want to replace a hidden field with some other values after the script has been called once youll have to do it manually: $query->param(hidden_name,new,values,here);