here is the original:

<name>willy

<desc>needs to take a nap

<email>[EMAIL PROTECTED]





here is the result that I want:

<section>
     <name>
          willy
     </name>

     <desc>
          needs to take a nap
     </desc>

     <email>
         [EMAIL PROTECTED]
     </email>
</section>






if i have the whole thing in one variable $data, then

$data =~ s/<(.+?)>(.*?)<(.+?)>/<$1>$2<\\$1><$3>/;

might work (untested) for the the <name> part... but i need to be able
to work with $3 as if it
were $1 later on...  


perhaps i need a way to parse this several times over, but I'm not
sure about the best way.  this kind of data munging is really making
my brain hurt.

a couple of suggestions would make me a happy camper :)




-- 
Willy
http://www.hackswell.com/corenth

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to