hello,
   
  thanks for the advice. You're right - I should have given more data. The 
reason I'm trying to kill elements from the XML is because the size of the XML 
I'm dealing with can get hideous - up to 100Mb. I read Uri's article on 
slurping and that helps alot ( http://www.perl.com/pub/a/2003/11/21/slurp.html 
) ie avoiding line by line processing gained big speedup. Basically there are a 
lot of legacy scripts using XML::Simple that I'd like to leverage (which were 
obviously done on smaller xml's!)...hence looking to pre-slurp and pre-kill 
unneeded entities from the input XML.
   
  I'm open to using a module but pure reg exp (non line-by-line) seems 
faster...and speed is important in this case due to filesize.
   
  Grateful for any ideas u may have.

  Cheers, Alan
  
Jay Savage <[EMAIL PROTECTED]> wrote:
  On 4/29/06, Alan Campbell wrote:
> hello folks,
>
> I'm trying to do a 'medium' greediness regular expression. Here's what I 
> mean. I need to grab all of the DW_TAG_TI_reserved stuff and kill it (italics 
> below)
>
> 
> DW_TAG_TI_assign_register
> 
> DW_AT_location
> 
> DW_OP_reg0
> 
> 
> 

[snip]

A couple of thoughts: If you read this list regularly, you already
know the advice you're going to get: there are hundreds of xml modules
on CPAN. Use them! Don't reinvent the wheel.

If you really insist on doing this by hand, we need to see more code.
How are you approaching this? On the surface, it looks pretty simple:

{
$lf = "\n";
local $/ = "" . $lf;
whlie (<>) {
print unless /DW_TAG_TI_reserved/;
}
}

Your question, though, leads me to think there's more going on.

So let me just reiterate my original advice again: use a mudule.

HTH,

-- jay
--------------------------------------------------
This email and attachment(s): [ ] blogable; [ x ] ask first; [ ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com http://www.dpguru.com http://www.engatiki.org

values of â will give rise to dom!


                
---------------------------------
Love cheap thrills? Enjoy PC-to-Phone  calls to 30+ countries for just 2¢/min 
with Yahoo! Messenger with Voice.

Reply via email to