[Bioperl-l] Apologies in order

Tim Bunce Tim.Bunce@pobox.com
Mon, 23 Sep 2002 15:21:02 +0100


On Sun, Sep 22, 2002 at 06:48:58PM +0100, Ewan Birney wrote:
> 
> INIT --> BEGIN block out.  As far as I can see we only need to wrap in
> BEGIN the test for Error.pm being in there, but... is there a good reason
> to initialise static variables in a BEGIN block or not? (Tim... are you
> still listening?

[Just skimming really.]

> Do you have a view?)

The only time you should need to initialise a static variable in a
BEGIN block is if later in the same file you 'use' a module that
(may use a module that) uses that variable at compile time (not
very likely) or that calls a function/module in the original file
which uses that variable (possibly more likely but also not a good idea).

The compiled op tree of a BEGIN block is discarded after it's
executed which frees up some memory. But I _think_ the code outside
of any subs in a used/required file is treated in the same way.

So my view is that there's no significant value in it.

Tim.