Have a look at , for ActivePerl documentation. As an alternative to ActivePerl, there is Strawberry Perl. This section describes what is ActivePerl – a free Perl engine for Windows, Perl Tutorials – Herong’s Tutorial Examples – Version , by Dr. Herong Yang. Easily learn how to install Perl and run your first script. If you are on Windows, you may see a choice of ActivePerl and Strawberry Perl.
|Published (Last):||15 January 2005|
|PDF File Size:||11.28 Mb|
|ePub File Size:||18.99 Mb|
|Price:||Free* [*Free Regsitration Required]|
I still run scripts off the command line in windows using ActivePerl, but for development I like being able to dynamically step through the script line by line. Because of this we almost always use objects when working with Tkx widgets.
A menu called “help” will be flushed right on Unix, even though this style seems to be out of fashion in modern Unix applications. In a real application there would be additional code between line 15 and 17 to set up the rest of the application window, but for this demonstration we’ll just leave the window empty. In line 14, we obtain a Tkx:: The application’s start and end signifies the starting and stopping of the webserver.
Tkx::Tutorial – How to use Tkx
Open up notepad or your preferred simple text editor and let’s make a beginning script. How do I use ActivePerl? What is Windows Script Host? If you try to call Tkx:: A major complication in the mapping to Perl is how to invoke subcommands on Tk widgets. This documents core Tk and useful add-on packages that are part of ActiveTcl.
– A tutorial about Perl and ActivePerl. Installing mod_perl. Includes examples.
The subroutines, or events, will be called at their designated times: Perl Forum Contact Us. Most real GUI application will need a menu line at the top of the application window or screen. What happens is that Tkx invoked the “tk messageBox” command, but the Tcl “tk” activeeperl only takes the subcommands listed in the error message above and refuse to do anything about “messageBox”. The corresponding character of the -label will be underlined and you will be able to select this entry by pressing the key when the menu is active.
What Is ActivePerl?
The code to make this happen is:. Additional commands can be loaded from Tcl packages. Instead, they create functions in a Tcl namespace with a name matching the package name. A window with the text “Hello, world” should appear on your screen. It also provide a convenient way to invoke subcommands methods on the widgets. MainLoop call at the end.
In line 5 and 6 we set up some window manager attributes of the main application window. When you launch the ActivePerl installer, PerlScript is one of the components you can optionally install.
ActivePerl and PerlScript are required on the webserver that is providing the webpages, but are not required on the client. To test the installation, make sure the program has fully completed installation and then run through the following:.
ActivePerl is just a distribution of Perl. It allows websites to execute Perl code on the local machine as the current user. Double underscores in names have yet another meaning that we will tell you about in the next section.
This function will return when the application tutoial has been destroyed. In some cases the “synopsis” section describing the package will spell out the package name, but in cases like this we have found no better way than to look into the pkgIndex.
Let’s start with the mandatory exercise of creating an application that greats the world. Similar reasoning exists for the “bell”. You might want to use this as a starting point for your own Tkx applications. The Tkx distribution contains a script called menu which is a runnable version of the program shown here.
The package documented as “BWidgets” should be loaded as “BWidget” acfiveperl the “s” and the package documented as “IWidgets” should be loaded as “Iwidgets” with a lower case “w”.
I just recently installed ActivePerl 5. The widgets are identified by path names of the form. This example loads the “Tktable” package in order to make the table command available for createing table widgets:.
Having you own application-specific widget class provides a place to add methods discovered by refactoring repeated code in your application. This translation is relatively straightforward and basically involves adding the prefix “Tkx:: In this case the callback destroys the window, which in turn terminates the application.
The same rules apply to the function names in the Tkx:: As an alternative to ActivePerl, there is Strawberry Perl. Aqua applications will also need to add the “About” function on the application menu instead of the “Help” menu as is common on other platforms.