[sf-perl] determining console or xwindows mode

David Alban extasia at extasia.org
Tue Mar 2 20:35:12 PST 2010

caveat:  you can be running under X and not have your $DISPLAY set.
not optimal, but it happens.

consider also checking for X11 libs and/or an X server process in the
process table.

On Sun, Feb 28, 2010 at 6:58 PM, Quinn Weaver <quinn at fairpath.com> wrote:
> If you're running under X, the DISPLAY environment variable should be set.
> So do:
> if ($ENV{DISPLAY}) {
>    ...

Live in a world of your own, but always welcome visitors.

More information about the SanFrancisco-pm mailing list