jimford has asked for the wisdom of the Perl Monks concerning the following question:

Hi.

After a long while away from Perl, I want to do a simple job with Perl Tk on a laptop with Xubuntu 11.04 installed.,

I used Cpan to update everything and install the Tk module, and all appeared to go OK.

Just to check that it all worked, I tried running the "Hello World" program shown in the O'Reilly book on page 10, however whilst it appeared to run without errors, nothing was displayed on the screen.

Running the program with the -w switch just showed a "Useless use of a constant in a void context" warning, which seems innocuous.

I'd be grateful for any help here, please!

Jim

Replies are listed 'Best First'.
Re: Perl Tk on Xubuntu problem.
by zentara (Cardinal) on Jun 15, 2011 at 18:35 UTC
    It sounds like a weird installation problem. The first thing I always do, when running into trouble, is try installing Tk manually from the tarball. Download from latest Tk , unpack the tarball, and do the steps "perl Makefile.pl", then "make", then as root, "make install". It should work, and if not, report back what errors you received at which step.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
      Thanks for the reply.

      It wasn't a "weird installation problem", more like a tiresome newbie problem - I'd put "Mainloop" instead of 'MainLoop'!

      I've got my hair shirt on now. How many days do The Monks require me to wear it?

      ;^)

      Jim

        A little experimentation suggests that in addition to not running with warnings enabled (was Mainloop the innocuous 'useless constant' in question?), the miserable supplicant was also running without strictures! If this is so, the period of hair-shirt-wearing is adjudged to be 6 months!

        >perl -le "use Tk; Mainloop; " >perl -w -le "use Tk; Mainloop; " Useless use of a constant (Mainloop) in void context at ... >perl -wMstrict -le "use Tk; Mainloop; " Bareword "Mainloop" not allowed while "strict subs" in use at ... Execution of -e aborted due to compilation errors.