Chapter 1. Introduction to Perl/Tk

There are many different modules available that extend the functionality of Perl. This book will concentrate on the Tk module. The Tk module allows us to easily add a graphical interface to our Perl scripts and still use all the features that make Perl great. Instead of requiring a typed command with some options or user input on the command line, your program is invoked with an icon or a simple command and the interface handles everything from there.

The Tk extension to Perl doesn't come with the standard distribution of Perl.[1] You'll need to get it separately from a CPAN site and install it. After you install the Tk module, you simply add use Tk; to the top of your Perl scripts.

[1] Unless you get the Win32 binary from CPAN, or another pre-built distribution such as ActiveState Perl.

Get Learning Perl/Tk now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.