| Previous | Next
Debugging and PrototypingPerl/Tk ProgramsDebugging a Perl/Tk program need not be different from debugging a nongraphical program; you can always sprinkle You normally run programs by typing the program name at the command prompt: % or: C:\> When you invoke the program this way, any printed output goes to that terminal window. If you don't put a If that old-fashioned way isn't to your liking, perhaps the slightly newer old-fashioned way of using the standard Perl debugger is. The debugger has built-in Tk support, though you must use the [bug@Pandy atk]$ As you see, we can not only print debug information, but also do simple prototyping. An even better environment for this sort of activity is the program ptksh. It's part of a standard Perl/Tk installation and, as its name suggests, it's a Perl/Tk shell that allows us to interactively enter and test Perl and Tk commands. Figure 1-3 shows a sample ptksh session. Figure 1-3. ptksh sessionIf you're really into graphical debugging, treat yourself to the CPAN module Devel::ptkdb, an excellent, sophisticated Perl/Tk debugger. Simply invoke Perl with a [bug@Pandy atk]$ Figure 1-4 shows a ptkdb session. Figure 1-4. ptkdb session |