PDA

View Full Version : Tk.pm


DELOCH
08-11-2006, 03:24 AM
I don't know where to find Tk.pm for Win98

can you please help me?

Thanks :D

FishMonger
08-11-2006, 04:13 AM
Tk comes as one of activestate's core modules.

Your starting point when looking for modules should always be CPAN.
http://search.cpan.org/
http://search.cpan.org/search?query=tk&mode=all
http://search.cpan.org/~ni-s/Tk-804.027/pod/UserGuide.pod

KevinADC
08-11-2006, 05:53 AM
you can check the activestate repository too:

http://aspn.activestate.com/ASPN/Modules/Perl?

DELOCH
08-14-2006, 07:09 PM
My Tk Package does not work... I have all the activeState modules...

is it because i am using Microsoft Windows?

KevinADC
08-14-2006, 07:44 PM
Tk works on Windows.

DELOCH
08-16-2006, 12:56 AM
give me an example so I can test :(

FishMonger
08-16-2006, 01:25 AM
#!/usr/bin/perl -w

use Tk;
use strict;

my $mw = MainWindow->new;
$mw->Label(-text => 'Hello, world!')->pack;
$mw->Button(
-text => 'Quit',
-command => sub { exit },
)->pack;
MainLoop;

http://search.cpan.org/~ni-s/Tk-804.027/pod/UserGuide.pod
http://www.oreilly.com/catalog/mastperltk/

DELOCH
08-16-2006, 10:52 PM
C:\Documents and Settings\dima\Desktop>perl perl.pl
Bareword "MainLoop" not allowed while "strict subs" in use at perl line 12.
Exception of perl.pl aborted due to compilation errors.

FishMonger
08-16-2006, 11:45 PM
You have a problem with your Tk installation.

How did you install the module.

Did you install activestate or are you still using XAMPP? If you're using activestate, how did you install it?

I have all the activeState modules...What does that mean? There are thousands modules that don't come with the base install.

DELOCH
08-16-2006, 11:51 PM
I use XAMPP Sepperately from PERL...

PERL is from perl addon from xampp, but it has a lot of modules, plus I tried to install apache another 10 times, failed at the mysql part :(

still, I have no complaints about my PERL installation, but i have tk.pm and other lots of modules, I don't know it does't run, i don't how to reinstall

btw i am using OOP not CGI ;)

KevinADC
08-16-2006, 11:51 PM
The code Fish posted works for me on Windows.

DELOCH
08-17-2006, 12:05 AM
What do i do then, i reinstalled the modules and nothing happened...

I use WinXP and I am not using CGI, i am using Dos programming

note: I have Perl cookbook(in russian), and Learning PERL(in english)

FishMonger
08-17-2006, 12:08 AM
What method did you use to install/reinstall the modules?

DELOCH
08-17-2006, 12:10 AM
I reinstalled the Activestate and it works like a charm thank you all for helping me ^_^