> is there a way to make a perl program find out whether a
> valid X-Server is running?
> I.e. $ENV{DISPLAY} is not a dummy address, if set.

Not in a useful way.

I have a headless (no monitor) Linux server, and a Windows
desktop with a X win server.  If I forget to run the X server it
doesn't mean that DISPLAY contains a dummy address...

If a script made a guess at whether I wanted X functionality
(say for installation), then it could get it wrong.  That would
be most annoying.

If a script wants to know if it can use the X server (or if one
exists), then it should go ahead and try.  If the toolkit returns
an error then you know you don't have one.

In the situation you want to use X if available, terminal
otherwise, wouldn't it be better just to use an option?

More detail, better answers!

Jonathan Paton

-- 
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,,

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to