Would someone mind explaining this?

while ~$p

I know in places ~ works as -1, but if that were the case while -$p would work... so what is this doing that the "-" cant?