Welcome to Perl

Perl is a scripting language meaning that the program that is run on the computer remains in human readable text for always and does not get compiled. The advantage of a script language like Perl is that it is easy to debug because you can change the code and run the program to immediately see the difference your changes made. The disadvantage is that script programs run slower then binary programs making it hard to create extremely large or task intensive programs using scripts.

A very small example of a Perl program.

print "Hello world!\n";

You can save that code sample to a file called hello.pl then run it like so perl hello.pl

Including a library

Perl has a very large collection of library files. Many come with Perl and still many more can be downloaded off the Internet.

Including a file or library in Perl can be done in many ways, the most popular is the use directive. In this example we want to do some image manipulation so we chose to use the Image::Magick library.

use Image::Magick;

In PerlQt development almost every Perl file will use the Qt library like so.

use Qt;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License