EPrints Technical Mailing List Archive
Message: #05230
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Perl question
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: [EP-tech] Perl question
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Thu, 3 Dec 2015 13:39:58 +0000
Hi, Bit of a random question - around the code in some Metafield modules. >From these two examples: https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/MetaField/Id.pm#L26-L31 https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/MetaField/Date.pm#L25-L37 In some Metafields, the sub-classing is done like this: ###### package EPrints::MetaField::Id; use EPrints::MetaField; @ISA = qw( EPrints::MetaField ); ###### In others, it uses a 'BEGIN' block like this ###### package EPrints::MetaField::Date; use strict; use warnings; BEGIN { our( @ISA ); @ISA = qw( EPrints::MetaField ); } use EPrints::MetaField; ###### Does anyone know the purpose of the different styles? Is there some subtle trick I'm missing here - or is it just different coding styles from different eras? I understand what the BEGIN block does (from http://perldoc.perl.org/perlmod.html#BEGIN%2c-UNITCHECK%2c-CHECK%2c-INIT-and-END) - but I'm unsure what it's doing/trying to do/was doing in this context... Cheers, John
- Follow-Ups:
- [EP-tech] Re: Perl question
- From: "Field A.N." <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: Perl question
- Prev by Date: [EP-tech] Re: undefined value error
- Next by Date: [EP-tech] Re: Perl question
- Previous by thread: [EP-tech] Re: Perl question
- Next by thread: [EP-tech] Re: Perl question
- Index(es):