use Win32::GUI; $screen = new Win32::GUI::DC("DISPLAY"); while(1) { ($x,$y) = Win32::GUI::GetCursorPos(); $color = $screen->GetPixel($x,$y); next if $color eq $last; $last = $color; printf ("%06X\n", $color); sleep 1; }