Packages



next up previous
Next: Predefined Variables Up: Subroutines and Packages Previous: Subroutines

Packages

Perl has a library of useful routines which you can include in your scripts. The Perl analogue of C's #include statement is require.

For instance, Perl has a library to do command-line parsing similar to C's getopt(3) function.

require 'getopts.pl';
&Getopts('vhi:');
if ($opt_v) { print "verbose mode is turned on\n"; }

It is also possible to write your own libraries and include them in other scripts.