Item8765: "use base qw(Somepackage);" shall not be used

Priority: Normal
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Branches: master
Reported By: OlivierRaginel
Waiting For:
Last Change By: OlivierRaginel
the use base was only intended to work alongside use fields.

perl 5.10 introduces to fill the gap, but the safe way is to:
use Module;
our @ISA qw( Module );

Globally and manually fixing all .pm files.

perl -i -ple's/^([^#]*)use base +qw\( *(\S+) *\);/$1use $2;\n$1our \@ISA = qw( $2 );/'

+ manually checked all differences.

-- OlivierRaginel - 24 Mar 2010


Please note that mostly the only difference is that use base is evaluated at compile time, whereas our @ISA is done at runtime, which can cause issues in BEGIN blocks (but I've checked them all and fixed them where needed).

-- OlivierRaginel - 25 Mar 2010

ItemTemplate edit

Summary "use base qw(Somepackage);" shall not be used
ReportedBy OlivierRaginel
SVN Range
AppliesTo Engine
Priority Normal
CurrentState Closed
Checkins distro:16fe39adc3e5 distro:295630b56215
TargetRelease minor
ReleasedIn 1.1.0
CheckinsOnBranches master
masterCheckins distro:16fe39adc3e5 distro:295630b56215
Topic revision: r9 - 08 Jun 2015, OlivierRaginel
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy