Re: parsing data structure

2009-06-05 Thread William
WowThank you thank you very much, Chas. Owens, that's great...appreciate that :-) William - Original Message > From: Chas. Owens > To: William > Cc: beginner perl mailling list > Sent: Friday, June 5, 2009 22:01:41 > Subject: Re: parsing data structur

Re: parsing data structure

2009-06-05 Thread Chas. Owens
On Fri, Jun 5, 2009 at 09:19, William wrote: > > I have been trying for hours, to make this data structure into hash, I need > help. Thanks. > > $str = > " >    (dr1 >        foo >        <1>(dr2 bar) >        <2>a >    ) > "; > > $hash = { >    "dr1" => { >            "<1>" => {"dr2" => {"predic

parsing data structure

2009-06-05 Thread William
I have been trying for hours, to make this data structure into hash, I need help. Thanks. $str = " (dr1 foo <1>(dr2 bar) <2>a ) "; $hash = { "dr1" => { "<1>" => {"dr2" => {"predicate"=> "bar"}}, "<2>" => "a" } }; dr1 and dr2 is