FIT3042 Lecture Notes - Lecture 23: Docstring, Plain Old Documentation, Javadoc
L23 : Perl Modules and OO
Using a Module
use Module (LIST);
●Module may have namespace hierarchy with ::
●LIST is oponal, not every module uses it
●LIST is a list of names of things you want to import (subrounes or variables)
Module.pm is inserted into code using require()
●Like C #include
●Indicates success by ending with a true value
Module -> import( LIST) called
●May insert funcons into caller’s namespace
●May not exist (not an error)
Example:
Simple:
Useful:
Object-Oriented Perl
Perl’s OO model is very lightweight
●No access control
●No compile-me checking
●No overload prevenon (final)
●No special syntax for constructors