in reply to Re^2: perlmonks downloadable code blocks
in thread perlmonks downloadable code blocks

Ah good point. e modifier to the rescue.
my $part; $post_body =~ s{<c>(.*?)<\/c>}{ ++part; qq{<a href='download?part=$part'>Download Me</a><pre>$1</pre>} }gei;