Hello.

I wrote a test scipt that uses the Tk.pm module on a server. I am just beginning to find uses for what Tk.pm has to offer.

The script is:

#!/usr/bin/perl use Tk; $win_main = MainWindow->new(); $win_main->title ("Main Window"); $button = $win_main->Button(text => 'OK', width => 10, height => 4); $button->pack(); MainLoop();

When I invoked the script, I received the following message:

~~~~~~~~~~~~~~~~
_X11TransSocketUNIXConnect: Can't connect: errno = 2
_X11TransSocketUNIXConnect: Can't connect: errno = 2
_X11TransSocketUNIXConnect: Can't connect: errno = 2
_X11TransSocketUNIXConnect: Can't connect: errno = 2
_X11TransSocketUNIXConnect: Can't connect: errno = 2
_X11TransSocketUNIXConnect: Can't connect: errno = 2
couldn't connect to display ":0" at
../foo_path/5.005/i386-bsdos/Tk/MainWindow.pm line 55.
MainWindow->new() at testtk.cgi line 4

(notice - the path was changed here to a generic path)
~~~~~~~~~~~~~~~~
The reply I received from the sys admin was the following:

"That error signifies that the script can not connect to the Unix Xwindows system that you are logging in from. You do not have $DISPLAY set up properly in your .Xauth or rc files."
~~~~~~~~~~~~~~~~

How do I do whatever this response is telling me to do in order to use Tk.pm?

Thank you.


In reply to How to interpret this Perl Tk.pm error? by newbie00

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.