From 76916bfac7886794380c51849b1bd87fef728bf0 Mon Sep 17 00:00:00 2001 From: Chris Fields Date: Wed, 6 Apr 2011 12:56:13 -0500 Subject: [PATCH] * 'use vars' -> our * run-time modification of @ISA is extremely evil and points to a problem that should be fixed in other ways. Commenting this out still passes tests; I openly implore anyone who used such evilness to please find a better fix --- Bio/Seq/Meta/Array.pm | 29 ++++++++++++++--------------- Bio/Seq/Quality.pm | 13 +++---------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/Bio/Seq/Meta/Array.pm b/Bio/Seq/Meta/Array.pm index b4feff7f6..b5f94f2b0 100644 --- a/Bio/Seq/Meta/Array.pm +++ b/Bio/Seq/Meta/Array.pm @@ -134,19 +134,13 @@ Internal methods are usually preceded with a _ package Bio::Seq::Meta::Array; -use vars qw(@ISA $DEFAULT_NAME $GAP $META_GAP); use strict; -#use overload '""' => \&to_string; - use base qw(Bio::LocatableSeq Bio::Seq Bio::Seq::MetaI); -BEGIN { - - $DEFAULT_NAME = 'DEFAULT'; - $GAP = '-'; - $META_GAP = 0; -} +our $DEFAULT_NAME = 'DEFAULT'; +our $GAP = '-'; +our $META_GAP = 0; =head2 new @@ -165,14 +159,19 @@ BEGIN { sub new { my ($class, %args) = @_; + + # run-time modification of @ISA is extremely evil (you should't pick your + # interface on the fly); this has no obvious effect on any tests so + # commenting out - cjfields 2011-4-6 + #defined inheritance according to stated baseclass, #if undefined then will be PrimarySeq - if (defined($args{'-baseclass'})) { - @ISA = ($args{'-baseclass'},"Bio::Seq::MetaI"); - } - else { - @ISA = qw( Bio::LocatableSeq Bio::Seq Bio::Seq::MetaI ); - } + #if (defined($args{'-baseclass'})) { + # @ISA = ($args{'-baseclass'},"Bio::Seq::MetaI"); + # } + #else { + # @ISA = qw( Bio::LocatableSeq Bio::Seq Bio::Seq::MetaI ); + # } my $self = $class->SUPER::new(%args); diff --git a/Bio/Seq/Quality.pm b/Bio/Seq/Quality.pm index ed2704f4f..99870e241 100644 --- a/Bio/Seq/Quality.pm +++ b/Bio/Seq/Quality.pm @@ -170,22 +170,15 @@ Internal methods are usually preceded with a _ package Bio::Seq::Quality; -use vars qw($DEFAULT_NAME $GAP $META_GAP); use strict; -#use overload '""' => \&to_string; - use base qw(Bio::Seq::Meta::Array); ## Is this the right place (and way) to define this? our $MASK_CHAR = 'X'; - -BEGIN { - - $DEFAULT_NAME = 'DEFAULT'; - $GAP = '-'; - $META_GAP = ' '; -} +our $DEFAULT_NAME = 'DEFAULT'; +our $GAP = '-'; +our $META_GAP = ' '; =head2 new -- 2.11.4.GIT