in reply to :-delimited lists in CGI parameters
The effect you are seeing is cause by the fact that you are accessing the parameter hash directly. If you use the correct funtion instead if works great.
Produces:use CGI qw/:standard/; $file = "bar"; defined param(selected) ? param(selected, param(selected) . ":$file") : param(selected , $file) ; print join ( "", map { hidden ( -name => $_, -default => $param{$_}, ) } param )
C:\test>perl param.pl selected=food <input type="hidden" name="selected" value="food:bar" /> C:\test>perl param.pl <input type="hidden" name="selected" value="bar" />
Its prob best to go with the right way instead though. Of course that all depends on your needs.
|
|---|