> Let's say I have a text file filled with: > > stuff > stuff > stuff > Users sometext > tom > dick > harry > Users more sometext > larry > curly > moe > moe > stuff > stuff > etc.
First of all, can this be XML instead? Then you can pass off the parsing to XML::Simple or something similar. If not, it looks like you want to organize by whitespace. (Like Tor said, a "group end" token would help.) It also looks like you want to end up with something like: $VAR1 = { 'sometext' => { 'tom' => 1, 'dick' => 1, 'harry' => 1, 'more sometext' => { 'larry' => 1, 'curly' => 1, 'moe' => 1 } } }; But possibly not using hashrefs (because you have duplicates) and possibly not nesting references. Can you be more specific (in a general way) about your secret requirements? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>