Perl for System Administration
Perl can be used to perform or automate system administration tasks on all platforms on which it is available. Some UNIX beginners who learn Perl, use it at first where shell scripts may be more appropriate. This use is still OK, because Perl can be a good alternative for them.
Besides the core language, those who wish to use Perl for System Administration should focus on the perlfunc document (which covers the various functions available inside Perl), and on its regular expressions capabilities (which are handier than what shell scripts offer).
Modules
Useful modules for system administration are:
- File::Spec - a core module to handle file and directory paths portably.
- String-ShellQuote - quote strings for passing through the shell. Also see the list forms of system.
- File-Path - a core module to create or remove directory trees (portably).
- File::Copy - a core module to copy files.
- IO-All - an all-in-one IO package with a lot of syntactic sugar. Non-core.