Bioperl: SeqIO drivers

Matthew Pocock mrp@sanger.ac.uk
Wed, 10 May 2000 11:24:26 +0100



Hilmar Lapp wrote:
<snip/>


> There is now code which initializes SeqIO such that the existing formats are
> already "registered". I'm not so familiar with perl guts, but I think there's
> something like a BEGIN section in a module that is executed upon
> use a_module;
> anywhere. So, by this section one could even have modules registering
> themselves once you include them as a use statement.

Be careful about this. BEGIN blocks are executed emediately after the perl parser
processes them, so they are executed once and only once when the package is loaded
for the first time. This is probably the behaviour that you want. I think that the
package method IMPORT (but check the name in the panther book) is executed
whenever a package is 'use'd by another. So - probably what you want is a BEGIN
block in SeqIO that registers each well-known driver, rather than having a BEGIN
or IMPORT block in each driver.
<snip/>

Matthew

=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================