13.5 Exercises (Miscellaneous)
13.5 Exercises (Miscellaneous)
1. (Easy: Documentation Reading, Research)
In a program, it is quite often necessary to deal with date and time, convert from one format to another, and convert one time in one zone to another. Find out what time-related functions are there in Core Perl. Perl has several modules that deal with time. Search www.cpan.org to locate some of these modules. Read their documentation, and use them in your programs.
2. (Hard: C, Perl and C, Research)
Quite frequently, parts or whole Perl modules are written in C. Research into how such modules are organized and written. Write some modules in C, but provide Perl interface to them. In addition, take some existing C modules and provide Perl interface for them.
3. (Medium to Hard: Perl and C, Research)
Research into how Perl scripts can be embedded in C code and vice versa. Write programs to illustrate what you learn.
4. (Easy to Medium: Unicode, Research)
The Unicode is a coding scheme for a huge number of alphanumeric and other characters for most major languages of the world. Perl provides modules for dealing with the Unicode. Find out what these modules are. Learn how Perl can be used with characters in the following languages: Greek, Russian, Arabic and Assamese.
5. (Medium to Hard: Mathematical Computation, Research)
Perl has a large number of modules for performing mathematical computation. Learn about the Math::Pari module that provides an interface to a large library of number-theoretic functions written in C. Read the documentation on this module. Study the RSA public-key algorithm, briefly discussed in Chapter 11. Implement the algorithm using the Math::Pari module.
6. (Medium to Hard: GUI, Research)
Learn how to write an attractive graphical user interface (GUI) in Perl. Rewrite any program that you have written already that can use a GUI. Write the GUI code and integrate it with your existing code.
7. (Medium to Hard: Mathematical Data Processing, Research)
Perl has a module called PDL and several related modules that allow one to deal with large matrices. Learn how to use these modules for image and audio processing.
