Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 about the Monastery: (6)
As of 2015-07-04 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls