in reply to reinterpolation of regexp (and strings?)
$data=~s#$r#$s#
How about
$data=~s#$r#$s#e [download]