in reply to popup_menus retaining values across queries

Like the other AM said, its a feature , but while delete will work, so will -override and creating a new cgi object

#!/usr/bin/perl -- use CGI; use strict; use warnings; my $q = CGI->new({1,-sham}); print join qq{\n}, $q->textfield(-name,1,-value,2), $q->textfield(-name,1,-value,2, -override,1), CGI->new({})->textfield(-name,1,-value,2), ;;;;;;; __END__ <input type="text" name="1" value="-sham" /> <input type="text" name="1" value="2" /> <input type="text" name="1" value="2" />

If you don't want any of the previous values, create new a object initialized from a hash  CGI->new({})

If you want to override some, don't delete them, -override => 1

Replies are listed 'Best First'.
Re^2: popup_menus retaining values across queries ( CGI->new({}) -override => 1 )
by afoken (Chancellor) on Sep 03, 2014 at 17:25 UTC

    use CGI qw( -nosticky ); also disables sticky values, as documented in "Pragmas" in the CGI documentation.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)