ptktrl - Simple perl/Tk shell with cmd line editing and a persistent history
% ptktrl ?I<scriptfile>? ... version informations ... ptktrl> $b=$mw->Button(-text=>'Hi',-command=>sub{print 'Hi'}) ptktrl> $b->grid ptktrl> o $b ... list of options ... ptktrl> ... ptktrl> ^D %
ptktrl is a simple perl/Tk shell to enter perl commands interactively. When one starts ptktrl a MainWindow is automaticly created. One can access it with $mw on the command line.
ptktrl supports command line editing and history via ReadLine interface (see Term::ReadLine). The last 50 commands entered are saved on exit to ~/.ptktrl_history. The history file is loaded into history cache the next time you start ptktrl.
To exit ptktrl use: ^D, exit, or quit.
^D, exit,
quit
The primary target of ptktrl is to experiment with perl/Tk widgets. To debug perl/Tk programs use the more powerful the perl debugger. Just enter ``O tk'' on debuggers command line to start the Tk eventloop. The only advantage ptktrl has is that history file support and that a MainWindow is automaticly created.
ptktrl provides some convenience function to make browsing in perl/Tk widgets easier:
displays a short help summary.
Dumps recursicely arguments to stdout. (see Data::Dumper).
appends "|\n" to each of it's arguments and prints it. If value is undef, '(undef)' is printed to stdout.
prints the option(s) of $widget one on each line. If no options are given all options of the widget are listed. See Tk::options for more details on the format and contents of the returned list.
Lists options of $widget matching the regular expression regexp.
If no argument is given it lists the modules loaded by the commands you executed or since the last time you called u.
u
If argument is the empty string lists all modules that are loaded by ptktrl.
If argument is a string, ``text'' it tried does a ``use Tk::Text''.
Same as for Term::ReadLine and perl. See Term::ReadLine and "ENVIRONMENT" in perlrun for further details.
If found in current directory it is read in an evaluated after the mainwindow $mw is created. .ptktrl_init can contain any valid perl code.
Contains the last 50 lines entered in ptktrl session(s).
Work only on Unix systems.
Term::Readline::Perl command line history is broken when used in conjunction with perl/Tk. Term::ReadLine::Gnu has no problems.
Tk::MainLoop function interactively entered or sourced in a init or script file will block ptktrl.
Tk Term::ReadLine perldebug
Achim Bohnet <ach@mpe.mpg.de>
Copyright (c) 1996-1998 Achim Bohnet. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Tk::FcyEntry, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::FcyEntry
CPAN shell
perl -MCPAN -e shell install Tk::FcyEntry
For more information on module installation, please visit the detailed CPAN module installation guide.