<?xml version="1.0" encoding="windows-1252"?>
<node id="872772" title="Re^2: Building data structures from CGI params" created="2010-11-21 04:53:17" updated="2010-11-21 04:53:17">
<type id="11">
note</type>
<author id="704949">
fullermd</author>
<data>
<field name="doctext">
&lt;p&gt;No, for the example HTML I had:&lt;/p&gt;

&lt;code&gt;
&lt;input type="text" name="foo{bar}" value="barval"&gt;
&lt;input type="text" name="foo{baz}" value="bazval"&gt;
&lt;/code&gt;

&lt;p&gt;that would yield me&lt;/p&gt;

&lt;code&gt;
$params = {
	"foo{bar}" =&gt; "barval",
	"foo{baz}" =&gt; "bazval"
}
&lt;/code&gt;

&lt;p&gt;I want&lt;/p&gt;

&lt;code&gt;
$params = {
	foo =&gt; {
		bar =&gt; "barval",
		baz =&gt; "bazval",
	}
}
&lt;/code&gt;


&lt;b&gt;EDIT&lt;/b&gt;

&lt;p&gt;Pshaw, you update'd while I was typing   :)&lt;/p&gt;

&lt;p&gt;
Yes, it's not (in the simple case) that hard to code up.  Handling params like &lt;c&gt;foo{bar}[6]{baz}[2]&lt;/c&gt; gets a little more involved though.  It's just complex enough that I'm confident I'll either make a mistake somewhere, or wind up with code with somewhat unpleasant performance characteristics in extremis.  So I'd hoped (and it seems such an obvious thing to want that I'd expected) there was an existing module I could mooch off^W^Wutilize...
&lt;/p&gt;
</field>
<field name="root_node">
872768</field>
<field name="parent_node">
872769</field>
</data>
</node>
