Previous Page Next Page

A.4. Perl Modules

Table A.6. General Programming
ModuleDescription
BenchmarkChecks and compares the speed of running code in CPU time.
ConfigAccesses Perl configuration options from the %Config hash.
EnvConverts the %ENV hash to scalars containing environment variables; e.g., $ENV{HOME} becomes $HOME.
EnglishProvides scalars in English or awk names for special variables; e.g., $0 can be represented as $PROGRAM_NAME.
GetoptProvides for processing of command-line options and switches with arguments.
ShellUsed to run shell commands within Perl scripts by treating the commands as subroutines; e.g., $today=date();
SymbolGenerates anonymous globs with gensym() and qualifies variable names with qualify().


Table A.7. CGI
ModuleDescription
CGICGI (Common Gateway Interface) class.
CGI::ApacheUsed with CGI.pm and the Perl-Apache API.
CGI::CarpHandles HTTP error messages and creates error log files.
CGI::CookieInterfaces with Netscape cookies.
CGI::FastInterfaces with Fast CGI.
CGI::PrettyProduces pretty formatted HTML code.
CGI::PushSimple interface to server push.


Table A.8. Error Handling
ModuleDescription
CarpGenerates die-like error messages to report line numbers of the calling routine where the error occurred. The subroutines that can be called from this module are carp(), croak(), and confess().
ErrnoLoads the libc errno.h defines.
Sys::SyslogProvides a Perl interface to the UNIX syslog(3) library calls.


Table A.9. File Handling
ModuleDescription
CwdGets the pathname of the current working directory. Produces an error message if used with the -w switch.
DirHandleProvides an object-oriented interface for directory handles.
FcntlLoads the libc fcntl.h (file control) defines.
File::BasenameSplits a filename into components or extracts a filename or a directory from full directory path.
File::CheckTreeRuns file tests on a collection of files in a directory tree.
File::CopyUsed to copy files or filehandles.
File::DosGlobDoes DOS-like globbing.
File::FindUsed to traverse a UNIX file tree.
File::FinddepthSearches depth-first through a file system.
File::GlobDoes UNIX filename globbing.
File::PathCreates and removes a list of directories.
File::SpecPerforms portable operations on filenames.
FileCacheAllows more files to be opened than permitted by the system.
FileHandleProvides an object-oriented interface to filehandle access methods.
SelectServerSaves and restores a selected filehandle.
flush.plWrites any data remaining in the filehandle's buffer or prints an expression and then flushes the buffer.
pwd.plSets the PWD environment variable to the present working directory after using chdir.
stat.plPuts the values returned by the stat function into scalars—$st_dev, $st_ino, $st_mode, $st_nlink, $st_uid, $st_rdev, $st_atime, $st_mtime, $st_ctime, $st_blksize, $st_blocks.


Table A.10. Text Processing
ModuleDescription
Pod::TextConverts pod documentation to ASCII-formatted text.
Search::DictSearches for a string in a dictionary (alphabetically ordered) file and sets the file pointer to the next line.
Term::CompleteProvides a filename-completion-like interface for prompting a user for partial input that can be completed by pressing a Tab key or a complete list of choices by pressing <Ctrl>-d.
Text::AbbrevCreates an abbreviation table, a hash consisting of key/value pairs from a list. The key is the abbreviation and the value is the string that was abbbreviated; e.g., ma/mail, mo/more.
Text::ParseWordsParses a line of text into a list of words like the shell does, stripping leading whitespace.
Text::SoundexMaps words to four character-length codes that roughly correspond to how the word is pronounced or sounds.
Text::TabsExpands tabs into spaces and unexpands tabs to spaces.
Text::WarpWraps text into a paragraph.


Table A.11. Database Interfaces
ModuleDescription
AnyDBM_FileA UNIX-based module providing framework for multiple DBMs.
DB_FileProvides access to Berkeley DB manager. See ftp//ftp.cs.berkeley.edu/ucb/4bsd.
DBIReturns a list of DBs and drivers on the system, and functions to interact with the database.
GDBM_FileProvides access to the GNU database manager. See ftp://prep.ai.mit.edu/pub/gnu.
NDBM_FileA UNIX-based module providing an interface to NDBM files.
ODBM_FileA UNIX-based module providing an interface to ODBM files.
SDBM_FileA UNIX-based module providing an interface to SDBM files.


Table A.12. Math
ModuleDescription
bigrat.plEnables infinite precision arithmetic on fractions.
Math::BigFloatSupports arbitary-sized floating point arithmetic.
Math::BigIntSupports arbitrary-sized integer arithmetic.
Math::ComplexSupports complex numbers to demonstrate overloading.
Math::TrigSupports trigonometric functions.


Table A.13. Networking
ModuleDescription
chat2.plAllows Perl to manipulate interactive network services such as FTP.
comm.plNewer than chat2.pl. Allows Perl to manipulate interactive services.
IPC::Open2Opens a process for reading and writing to allow data to be piped to and from an external program.
IPC::Open3Opens a process for reading, writing, and error handling so that data can be piped to and from an external program.
Net::PingChecks whether a remote machine is up.
SocketCreates sockets and imports socket methods for interprocess communication and loads socket.h header file.
Sys::HostnameGets the hostname for the system.


Table A.14. Time and Locale
ModuleDescription
I18N::CollateCompares 8-bit scalar data according to the current locale.
Time::gmtimeAn interface to Perl's built-in gmtime() function.
Time::LocalComputes the UNIX time (the number of non-leap-year seconds since January 1, 1970) from local and GMT (UTC) time.
Time::localtimeAn interface to Perl's built-in localtime() function.


Table A.15. Terminals
ModuleDescription
Term::CapProvides low-level functions to manipulate terminal configurations as a terminal interface to the termcap database.


Table A.16. Object-Oriented Module Functions
ModuleDescription
AutoloaderFor large modules, loads in only needed sections of a module.
AutoSplitSplits module into bite-sized chunks for autoloading.
Devel::SelfStubberGenerates stubs for self-loading modules to ensure that if a method is called, it will get loaded.
DynaLoaderUsed to automatically and dynamically load modules.
ExporterUsed by other modules to make methods and variables available through importation.
overloadUsed to overload mathmatical operations.
Tie::HashProvides methods for tying a hash to a package.
Tie::ScalarProvides methods for tying a scalar to a package.
Tie::SubstrHashProvides a hash-table-like interface to an array with constant key and record size.


Table A.17. Language Extension
ModuleDescription
ExtUtils::InstallFor installing and deinstalling platform-dependent Perl extensions.
ExtUtils::LiblistDetermines what libraries to use and how to use them.
ExtUtils::MakeMakerCreates a Makefile for a Perl extension in the extension's library.
ExtUtils::ManifestAutomates the maintenance of MANIFEST files, consisting of a list of filenames.
ExtUtils::MiniperlWrites C code for perlmain.c, which contains the bootstrap code for making archive libraries needed by modules available from within Perl.
ExtUtils::MkbootstrapIs called from the extension's Makefile to create a bootstrap file needed to do dynamic loading on some systems.
ExtUtils::MksysmlistsWrites linker option files used by some linkers during the creation of shared libraries for dynamic extensions.
ExtUtils::MM_OS2Overrides the implementation of methods, causing UNIX behavior.
ExtUtils::MM_UnixTo be used with MakeMaker to provide methods for both UNIX and non-UNIX systems.
ExtUtils::MM_VMSOverrides the implementation of methods, causing UNIX behavior.
FcntlTranslates the C fcntl header file.
POSIXProvides the Perl interface to IEEE std 1003.1 identifiers.
SafeProvides private compartments where unsafe Perl code can be evaluated.
Test::HarnessUsed by MakeMaker to run test scripts for Perl extensions and produce diagnostics.


Previous Page Next Page