Appendix 4
On Built-in Functions
Perl has a large number of built-in functions. Descriptions of these functions are readily available in Web site such as www.cpan.org. We list only some functions below.
• Functions for SCALARs or strings: chomp, chop, crypt, hex, index, lc, lcfirst, length, oct, ord, pack, q/STRING/, qq/STRING/, reverse, rindex, sprintf, substr, tr///, uc, ucfirst, y///
• Regular expressions and pattern matching: m//, s///, split
• Numeric functions: abs, atan2, cos, exp, hex, int, log, oct, rand, sin, sqrt, srand
• Functions for real @ARRAYs: pop, push, shift, splice, unshift
• Functions for list data: grep, join, map, qw/STRING/, reverse, sort, unpack
• Functions for real %HASHes delete, each, exists, keys, values
• Input and output functions: close, closedir, die, print, printf, read, readdir, select, sysread, , warn, write
• Functions for filehandles, files, or directories: chdir, chmod, chown, chroot, glob, link, lstat, mkdir, open, opendir, rename, rmdir, unlink
• Keywords related to the control flow of a perl program: continue, die, do, eval, exit, goto, last, next, redo, return, sub
• Keywords related to scoping: local, my, our, package, use
• Functions for processes and process groups: exec, fork, getppid, kill, pipe, qx/STRING/, sleep, system, wait, waitpid
• Keywords related to perl modules: do, import, no, package, require, use
• Keywords related to classes and object-orientedness: bless, package, ref, tie, tied, untie, use
• Low-level socket functions: accept, bind, connect, getpeername, getsockname, getsockopt, listen, recv, send, setsockopt, shutdown, socket, socketpair
• Fetching network information: gethostbyaddr,gethostbyname, gethostent, getnetbyaddr, getnetent, getprotobyname, getprotobynumber, getprotoent, getservbyname,
getservbyport, getservent, sethostent, setnetent, setprotoent, setservent
• Time-related functions: gmtime, localtime, time, times