I am having some problems dealing with a colon delimited list inside a cgi script. My lists will not show up correctly inside a hidden() input within the browser. Here is a snippet:
defined $param{selected}
? ( $param{selected} .= ":$file" )
: ( $param{selected} = $file );
join ( "", map {
hidden (
-name => $_,
-default => $param{$_},
)
} keys %param )
Within the script, hidden() seems to forget everything after and including the first :. If I change the hidden() to Dumper, the correct stuff is displayed in the browser window, showing that $file is properly defined. Running the script from the comamnd line also returns the bad results so it isn't specifically a browser problem. What is strange is that if I run:
perl -le 'use CGI qw/ :standard /; print hidden( -name => "foo", -defa
+ult => "foo:bar" )'
hidden() seems to do the right thing.
Is there something I am missing in this snippet? Is there a better way to pass a list within cgi arguments?
Thanks in advance.