Solution

Phosphorus pentachloride reacts with both alcohols and carboxylic acids, replacing the –OH group by –Cl:
$R-OH + PCl_5 \rightarrow R-Cl + POCl_3 + HCl$
$R-COOH + PCl_5 \rightarrow R-COCl + POCl_3 + HCl$ (acid chloride)
Hydrochloric acid converts alcohols to alkyl chlorides (with $ZnCl_2$, Lucas reagent) but it cannot convert a carboxylic acid into an acid chloride. Chlorine and hypochlorous acid do not replace –OH by –Cl.
So the reagent is phosphorus pentachloride, $PCl_5$ (also used to test for an –OH group, since HCl fumes are given off).

Concept PCl5 replaces OH by Cl

Alcohols, Phenols and Ethers in past papers

65 questions from this chapter have appeared across 26 exam years.