Skip to Main Content
Learning Perl/Tk
book

Learning Perl/Tk

by Nancy Walsh
January 1999
Beginner content levelBeginner
373 pages
9h 43m
English
O'Reilly Media, Inc.
Content preview from Learning Perl/Tk

1.3. Why Use a Graphical Interface?

Hopefully, you bought this book (or are considering it in the bookstore) because you have some idea of why you might want to use a graphical interface for one or more of your scripts. Just in case you don't, read on....

Because you are familiar with writing Perl scripts, you understand the ways you can get information in and out of one. It usually involves a combination of reading/writing files, command-line options, and possibly, data in or out at application runtime (STDIN/STDOUT, using pipes (|) or <>. Certain applications can run with no input, and others, such as an installation script, require constant information fed to it from the user: Do you want to install this file? Can I overwrite this DLL? Do you want to create this directory? Do you want the help files? Sometimes you can set up a bunch of defaults so the user just has to press return to say yes, but then they are stuck sitting at the keyboard and waiting for the next question to come up. Wouldn't it be nice to gather all that information up front and then have the user press a Go button to execute all the steps after the decisions were made?

A GUI interface adds a little flair and professionalism to an application. However, there are times when it would be overkill to add a GUI to a script. If all you are doing is reading in one file, munging a bit with no user input, and spitting out another, a GUI would be silly and unnecessary. GUI interfaces work best where you require a lot ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Perl/Tk

Mastering Perl/Tk

Stephen Lidie, Nancy Walsh

Publisher Resources

ISBN: 1565923146Supplemental ContentCatalog PageErrata