in reply to Re^2: 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 [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!