in reply to Regexp Substitution Problem!!

I'm not really sure what you're trying to do. If all you want to do is remove the A~~~(.*)~A sections from the string, then all you need is something like:

s/A~~~(.*?)~A//g;

Note that I've changed your .* to .*?. See Death to Dot Star! for the reason why.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg