Chapter 13. Modularize It, Package It, and Send It to the Library!
Upon finishing this chapter, you should have a good understanding of how to read and create a Perl procedural style module similar to this one found at http://www.perlmonks.org.
package MyModule; # filename is myModule.pmuse strict;use warnings;use Exporter;use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);$VERSION = 1.00;@ISA = qw(Exporter);@EXPORT = ();@EXPORT_OK = qw(func1 func2);%EXPORT_TAGS = ( DEFAULT => [qw(&func1)], Both => [qw(&func1 &func2)]);sub func1 { return reverse @_ }sub func2 { return ...
Get Perl by Example now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.