Seems like there are two things you can do to correct this:

1) Change the line "use TK;" to "use Tk;" (make the "K" lowercase).
2) Change the line "MainLoop;" to "$mw->MainLoop;".

I'm not sure what the differences between TK and Tk are (or why there's two
Tk modules), but apparently the Tk module exports MainLoop as a function
while the TK module doesn't.  If you're going to use TK, then you have to
call it as a method (with the $mw->MainLoop syntax).

-Jesse


-----Original Message-----
From: Gregg Martinson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 11:41 AM
To: [EMAIL PROTECTED]
Subject: very basic TK ?


Hello,  
    I have been playing with TK today...reading the O'Reilly book on the
subject, and am now trying to work through some of the examples. I have
typed verbatim the "hello world" program.  It compiles and executes, but
quits before any GUI shows on the screen.  I'm sure that this is a
ridiculouly easy thing to fix, but I can't figure it out.  Here's the script
===========
#! /usr/bin/perl
use TK;
my $mw=MainWindow->new;
$mw->title('Hello world');
$mw->Button(-text=>'done',-command=>sub{exit})->pack;
MainLoop;
===========
Perl spins, and then returns me to the console prompt.  What gives? TIA
gregg
  





__________________________________________________
D O T E A S Y - "Join the web hosting revolution!"
             http://www.doteasy.com
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to