|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Re^2: How to detect X?by blazar (Canon) |
| on Feb 21, 2005 at 04:39 UTC ( [id://432984]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
You could simply try the X version first. If the X server fails to appear, exec returns with an error -- the only way exec can return. Then try the command-line version.This is fundamentally what I had thought of doing myself, even though, really I was rather thinking of putting some minimal Tk code in an eval block instead. Yes: I know that basically that would mean doing the same thing twice, but it seems somewhat cleaner... of course unless there's an even cleaner solution.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||