in reply to Changing a bit in a string

Looks to me that the following does the job:
$address -= 16 if $address & 16;
Cheers,
Rob