The -OH group of an alcohol or the -COOH group of a carboxylic acid on can be replaced by -Cl using
(a) The -OH group of alcohol or the -COOH group of a carboxylic acid is replaced by -Cl using phosphorus pentachloride (i.e PCl5)
ROH + PCl5RCl + POCl3 + HCl
Alcohol
RCOOH + PCl5RCOCl + POCl3 + HCl
Acid