原文:
1. What is perl/Tk?
Perl/Tk (also known as pTk or ptk) is a collection of modules and code that attempts to wed the easily configured Tk 8 widget toolkit to the powerful lexigraphic, dynamic memory, I/O, and object-oriented capabilities of Perl 5. In other words, it is an interpreted scripting language for making widgets and programs with Graphical User Interfaces (GUI). (Examples of widget programs [not necessarily written in perl/Tk] include xterm, xclock, most web-browsers, etc.. They are programs with "GUI" interfaces of one sort or another and are subject to the effects of your window manager.)
The current release of Perl/Tk is based on Tk8.0, the widget Toolkit originally associated with the Tcl (Tool command language) scripting language. However, Perl/Tk does not require any familiarity with Tcl, nor does its installation depend on any Tcl code apart from that packaged within Perl/Tk. Perl/Tk uses perl 5 syntax, grammar, and data structures.
The production release of perl/Tk was written primarily by Nick Ing-Simmons mailto:Nick.Ing-Simmons@tiuk.ti.com at Texas Instruments in Northampton, England, to work with the latest version of Larry Wall's ``perl''. Plans are afoot to track such enhancements as Tk 8.4 and Perl 6.
The pTk code proper is an externally callable Tk toolkit (i.e. a re-write of the Tk 8.0 code that allows easier external linking & calling, especially by perl). Ptk can then be called from Perl 5 via the Tk.pm et al perl glue modules. Hence "ptk" does not necessarily refer to Perl Tk but could be taken to mean portable Tk - given a glue package to another language. The stated goal of the pTk code is to have its library usable from perl, Tcl, LISP, C++, python, etc.. It just so happens that present work is concentrating on perl.
Historical note: "ptk" was known as "ntk" before about 11:30 EST 4 May 1995.
The perl/Tk language is itself further extensible via the standard perl 5 module mechanism. A number of composite widget and special character extensions to the language have been written using perl modules.
译文:
1. 什么是Perl/Tk?
Perl/Tk (简称pTk或ptk)提供了一些模块和代码,其目的是把易用的“Tk8窗口组件工具箱”(widget toolkit)结合到具有强大的文本处理、动态存储、输入/输出和面向对象能力的Perl5中。换句话说,它是用于编写“窗口组件”(widget)等图形用户界面(GUI)程序的一种解释脚本语言。(窗口组件的例子很多,并非一定用Perl/Tk编写,例如xterm,xclock以及大部分的网络浏览器等等,这些都是具有图形用户界面的程序。)
现有版本的Perl/Tk主要基于Tk8.0,而这个窗口组件工具箱最初是与Tcl 脚本语言(即“工具命令语言”,Tool command language)的一部分。但是,使用Perl/Tk并不要求你熟悉Tcl语言,并且它的安装也不需要依靠除了Perl/Tk安装包之外的任何Tcl的代码。Perl/Tk完全使用Perl5的语法、文法和数据结构。
Perl/Tk的原代码最初是由英格兰北安普敦Texas Instruments的Nick Ing-Simmons编写的,它可以和Larry Wall最新版本的Perl一起工作。目前的计划是到Perl6时,改进为Tk8.4。
pTk 的代码本质上是一个可以被外部调用的Tk工具箱,也就是说它重写了Tk8.0的代码从而使其可以被更加方便从外部链接和调用(尤其是被Perl)。这样, ptk就可以被Perl5简单的通过Tk.pm这样的Perl模块来调用了。但是,“ptk”并不一定局限于“Perl工具箱”(Perl Tk),而更好的是被解释为“便携式的工具箱”(portable Tk),也就是说它可以为其它很多语言提供了Tk工具包。因为,实际上pTk代码的目标是要为Perl、Tcl、LISP、C++、python等多种语言提供可用的库(library),而只是“碰巧”目前的工作主要是集中在Perl语言方面而已。
关于历史问题的说明:“ptk”在大约11:30 EST 4 May 1995以前曾被称为“ntk”。
Perl/Tk语言本身是可以按照Perl5的模块机制进行扩展的,并且实际上很多合成的窗口组件和特别的扩展组件已经被做成了Perl模块了。