Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Search and substitute into data structures

by rbi (Monk)
on Apr 30, 2007 at 19:26 UTC ( #612847=note: print w/ replies, xml ) Need Help??


in reply to Re: Search and substitute into data structures
in thread Search and substitute into data structures

Thanks! And what about wrap_cdata, to wrap the content with <![CDATA ]> in the approach of your trick ?


Comment on Re^2: Search and substitute into data structures
Re^3: Search and substitute into data structures
by Sidhekin (Priest) on Apr 30, 2007 at 19:47 UTC

    Thanks! And what about wrap_cdata, to wrap the content with [I assume] <![CDATA[ ]]> in the approach of your trick ?

    Same thing, as long as you know how to do it with a single string. Perhaps something like this:

    sub wrap_cdata { for (@_) { eval { wrap_cdata(@$_); 1 } and next; eval { wrap_cdata(values %$_); 1 } and next; s/(?<![^>])([^<]+)/<![CDATA[$1]]>/g; } }

    Or not. I don't know why your original unwrap did not use the /g modifier. So please, season to taste.

    print "Just another Perl ${\(trickster and hacker)},"
    The Sidhekin proves Sidhe did it!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://612847]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-10-25 09:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (142 votes), past polls