Perl programmers are typically minimalists. They most often use plain text editors, such as vi, rather than the visual integrated development environment (IDE) often used with other languages. Learning of an IDE can be a task in itself, which may not be worth it if you are not a professional programmer or computer science student. I use emacs30 for editing Perl programs, which is a freely available minimal development environment with the advantages of syntax coloring, basic syntax checking, and formatting, in addition to some more exotic and harder to use options. However, emacs is a little old fashioned and has a totally different set of short cut keys that must be learned.
A debugger comes with most Perl distributions. Invoke the
debugger with a perl -d option. For example, to
debug the hello world program above
where I have put the commands to by typed in red. Use the
command s to single step through the program line by
line, the command x $variable_name to print the value of
a variable, and q to quit. The specifics of
debuggers vary by distribution.
Perl includes modules to assist with unit testing in the Test::More and Test::Harness modules. An example test for the object oriented code example above is
The argument to the use Test::More statement declares
2 tests. The isa_ok function tests that the object
was constructed correctly. The is function tests
that the id was returned correctly. Obviously, more
testing is needed for production code. The output from this test
script is
Perl documentation is described below. For more on Perl tools see the CPAN site.
There are no user comments.
Please send ideas and opinions by email at alexamies@gmail.com.