in reply to Replacing strings

$var =~ s/%ad/$temp/g

What did you try?