  We develop a numerical method for detecting a vortex unbinding transition in
a two-dimensional system by measuring large scale fluctuations in the total
vortex dipole moment ${\vec P}$ of the system. These are characterized by a
quantity $\cal F$ which measures the number of configurations in a simulation
for which the either $P_x$ or $P_y$ is half the system size. It is shown that
$\cal F$ tends to a non-vanishing constant for large system sizes in the
unbound phase, and vanishes in the bound phase. The method is applied to the XY
model both in the absence and presence of a magnetic field. In the latter case,
the system size dependence of $\cal F$ suggests that there exist three distinct
phases, one unbound vortex phase, a logarithmically bound phase, and a linearly
bound phase.
