in reply to Getting cursor position withour canvas

use X11::GUITest qw/GetMousePos/; my ($x, $y, $scr_num) = GetMousePos();
Should work.