1.5 Defining Modules


To begin, take a file of subroutine definitions and call it something like Newmodule.pm . Now, edit the file and give it a new first line:

 package Newmodule; 

and a new last line 1; . You've now created a Perl module.

To make a Celegans module, place subroutines in a file called Celegans.pm , and add a first line:

 package Celegans; 

Add a last line 1; , and you've defined a Celegans module. This last line just ensures that the library returns a true value when it's read in. It's annoying, but necessary.



Mastering Perl for Bioinformatics
Mastering Perl for Bioinformatics
ISBN: 0596003072
EAN: 2147483647
Year: 2003
Pages: 156

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net