Introducing UNIX and Linux |
PerlOverview |
Perl and the KernelWe have already mentioned some of the functions available in Perl, and have noted that functions often appear similar in name and in what they do to shell utilities. This is no accident. Recall that a UNIX system contains at its core the
kernel. The interface to this kernel is specified both in
the C language (POSIX.1) and as shell commands (POSIX.2). The shell
command names mimic - as far as is sensible - the names of the
corresponding C procedures. For example, to create a new directory,
the shell command The C language has been used to code the kernel, and much of the shell and Perl is written in C (or its more recent object-oriented derivative C++). The use of the names used by C to interface with the kernel thus gives the shell or Perl programmer a consistent window into the kernel. Anything (almost!) that can be coded in C on a UNIX system can be written in the shell or in Perl. |
Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck