[Bioperl-l] bioperl.lisp, bioperl-object-start, use, and use base?

Chris Fields cjfields at illinois.edu
Fri Oct 10 23:47:00 EDT 2008


Yeah, I forgot the import bit.  It really applies mainly when you 'use  
Foo qw(bar baz)' but it's always helpful to keep in mind when it applies

-c

On Oct 10, 2008, at 4:25 PM, George Hartzell wrote:

>
> Thanks.  I that's what I thought/googled.  I was afraid that it was
> some backward compatability best practice or something.  Two small
> edits (scoured from perlmonks)
>
> Chris Fields writes:
>> No, it shouldn't be necessary. "use 'Foo'" is the same as:
>>
>> BEGIN {
>>    require Foo;
>> }
>
> It also calls that package's import, so it's:
>
> BEGIN {
>    require Foo;
>    Foo->import();
> }
>
>>
>> ... and "use base 'Foo'" is the same as:
>>
>> BEGIN {
>>    require Foo;
>>    push @ISA, 'Foo';
>> }
>>
>
> and this doesn't to the ->import().
>
> Thanks,
>
> g.
>
>> chris
>>
>> On Oct 10, 2008, at 3:57 PM, George Hartzell wrote:
>>
>>>
>>> Why does the template provided by bioperl-object-start both
>>>
>>> use Bio::Root::Root;
>>>
>>> and
>>>
>>> use base qw(Bio::Root::Root);
>>>
>>> Is the first one necessary for some reason?
>>>
>>> g.
>>>
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>


More information about the Bioperl-l mailing list