[Bioperl-l] Re: removing BEGIN blocks?

Aaron J Mackey Aaron J. Mackey" <amackey@virginia.edu
Thu, 19 Sep 2002 13:58:51 -0400 (EDT)


I think that, in general, BEGIN blocks are only useful when you need to do
something during compile time that can't be done at runtime (i.e. load up
other modules to import subs that are later referenced, and would
otherwise be a compile-time error if you hadn't already loaded it).
Another example is to set a variable that will alter another module's
import behavior.  If you're just setting variables that won't get used
until runtime, then there's no reason to do it before/during compile time.

-Aaron

On 19 Sep 2002, Heikki Lehvaslaiho wrote:

> Aaron,
>
> I noticed you removed the BEGIN block from Bio::PrimarySeq and just kept
> the global static variable initialized there.
>
> Does that change give the code as ignificant speedup? Do you recommend
> that we do that in all modules with similar setup?
>
> I am thinking here, for example Bio::Tools::CodonTable. Translation
> speed has been an issue in the past.
>
> -Heikki
>
>
>

-- 
 Aaron J Mackey
 Pearson Laboratory
 University of Virginia
 (434) 924-2821
 amackey@virginia.edu