First, install the ActivePerl, the installation process to automatically add the PATH environment variable, so that after installation, you do not need to manually modify the PATH environment variable;
Bring up the command-line window via cmd, enter ppm, and then enter to open the Perl Package Manager.
Click the Warehouse button, search the repository for the TK module, then right-click, select Intall, and then tap the green arrow icon at the top right to start the installation;
After the installation is complete, write a Hello World example and save the file as tk_hello_world.pl:
#/usr/bin/perl-w UseTk; Usewarnings; UseStrict;my $MW= mainwindow->new ();$MW->geometry ("200x100");$MW->title ("Hello World");$MW->label (-text ="Hello World"),Pack(-side =" Left"); Mainloop;
Then, in the command line, type Perl tk_hello_world.pl, which pops up:
Run successfully!
Reference: http://www.ibm.com/developerworks/cn/aix/library/au-perltkmodule/
Installing the Perl Tk module under Windows