in reply to string substitution help

use strict would have caught that your value was stored in $message2 and your s///g are being acted on $message1. Oops!

-- Randal L. Schwartz, Perl hacker