What are the common pitfalls associated with Perl\'s eval, which might make you choose to use a module such as Try::Tiny?
Using eval on X11 function might still failed to keep alive.
The code is like
eval { @win_arrays = GetWindowsFromPid($pid); };
The script will be exited from
X Error of failed request: ...