> You don't say how these sections of text are demarked, but 
> assuming the matching requirements for the start and end of 
> the demarked sections are reasonable, you can do what you 
> need much more simply.

[applause] Brilliant, and exactly what I was asking for; unfortunately, it showed me that I was asking for the wrong thing. :\ Not horribly wrong, just a little off - but there's too much interaction between the results of this routine and the rest of the 'cleanup' routine to separate the two like this. What ends up happening when I try to use it this way is that the sub sees each chunk of data as a stand-alone piece and wraps paragraph markers around it - which results in the 'raw' piece always being a separate paragraph. So, it seems that this bit of processing has to remain part of the 'cleanup' routine itself - that is, I need to extract those pieces, mangle the main body, stick those pieces back in, and then finish paragraphing everything.

Darn it. Well, the intent was good, anyway - and thanks to all you wizards, I've learned something. Thank you!

Incidentally, I had to modify your regex a bit so it would get rid of the tags themselves:

my $raw_start = '[RAW]'; my $raw_stop = '[/RAW]'; $body =~ s[(?:^|\Q$raw_stop\E)(.+?)(?:\Q$raw_start\E|$)]{ my $toModify = $1; $toModify = cleanup($toModify); $toModify; }seg;

In reply to Re^2: Anchors, bleh :( by oko1
in thread Anchors, bleh :( by oko1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.