we have that
P=(2l+2w)
then
subtract 2L from both sides
P-2l=2l+2w-2l-----------> P-2l=2w
divide by 2 on both sides
(P-2l)/2=2w/2
(P-2l)/2=w------------------> w=(P-2l)/2
w=(P-2l)/2------------> w=(P/2)-(2l/2)---------> w=(P/2)-l
the answer is
w=(P/2)-l