while (1) { my ($x, $y) = GetCursorPos(); print "X is at $x, Y is at $y\n"; }