develooper Front page | perl.perl5.porters | Postings from January 2012

Re: [perl #108470] Term::ReadLine should use AE instead of Tk for event looping

Darin McBride
January 29, 2012 18:28
Re: [perl #108470] Term::ReadLine should use AE instead of Tk for event looping
Message ID:
On Sunday January 29 2012 2:35:34 PM you wrote:
> With Tk installed, but no X11 environment running, I get this:
> couldn't connect to display "/tmp/launch-YF2sgP/org.x:0" at
> /Users/sprout/.cpan/build/Tk-804.030-w5ZSVH/blib/lib/Tk/
> line 53.
> MainWindow->new() at t/Tk.t line 27
> # Looks like you planned 3 tests but ran 2.
> # Looks like your test exited with 2 just after 2.
> In case you haven’t guessed, I’m using Mac OS X.  Can you detect that

I couldn't guess that, I'm not rich enough to have a Mac. :-P :-D

> error and skip the test?  I’ve noticed that Tk passes its own tests with
> no X11 running.  I haven’t yet looked to see what it does.

When I unset my DISPLAY and rerun the TRL tests, I get about the same problem 
as you.  However, when I do the same thing with Tk, I get a bunch of ugly 
output about it :-S

Anyway, I think I've about patched this up - I'm almost afraid to make my next 
comment for fear of another horde forming, but my system upgraded AE in the 
meantime, and since AE 6.11, there has been a "die" at the top of 
AnyEvent::Impl::Tk, not sure if it was on purpose or not (it didn't show up in 
the Changelog, which makes me think not - Marc doesn't seem to be shy about 
what he does on purpose), and that made my tests fail even with DISPLAY set 

> Apart from that, your patch looks fine to me.

Here's the updated patch with eval's around the mainwindow functions to see if 
it loads or not.  It does mean that the AETk patch has to explicitly try it, 
whereas that shouldn't normally be necessary, but them's the breaks I guess. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About