We prove that if f and g are holomorphic functions on an open connected domain, with the same moduli on two intersecting segments, then f = g up to the multiplication of a unimodular constant, provided the segments make an angle that is an irrational multiple of $pi$. We also prove that if f and g are functions in the Nevanlinna class, and if |f | = |g| on the unit circle and on a circle inside the unit disc, then f = g up to the multiplication of a unimodular constant.