http://www.perlmonks.org?node_id=813456


in reply to Mimicking UNIX Eyes

Try the module X11::GUITest. It may help you get the cursor's position in X11. From the readme...

GetMousePos Returns an array containing the position of the mouse curs +or. my ($x, $y) = GetMousePos();

Combine this with a simple Tk window for drawing the eyes, and X11::GUITest should help ya get the cursor position so you don't need Tk to handle that part. Of course this approach is only good for X11 systems and isn't cross platform to Windows or OS X.