From the course: Perl 5 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Leveraging code with modules

Leveraging code with modules - Perl Tutorial

From the course: Perl 5 Essential Training

Start my 1-month free trial

Leveraging code with modules

- [Voiceover] Modules are collections of code that you may use along with your script. Modules may contain functions, data, or object-oriented classes. Many modules are available on CPAN, the Comprehensive Perl Archive Network. CPAN is a very popular repository for Perl modules. Modules are an excellent way to leverage your code or a code from others to make your coding projects easier and more efficient. Modules may be object-oriented or procedural. I strongly recommend that you stick with object-oriented modules as much as possible. They're much easier to integrate into your code and they are less likely to pollute your name space. Modules may be code, data, or both. Sometimes we don't think of data only modules but they do exist. For example, I have a module on CPAN which is just a list of country codes and state codes. Modules make it easy to reuse your code and data. This allows you to put more effort into writing good code that you can then reuse for many purposes.

Contents