[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] CORE::length



Below, the svn annotate and log of a change I didn't understand to BioPerl.

=====================================================
  2705  matsallac sub validate_qual {
  4015      jason     # how do I validate quality values?
  4015      jason     # \d+\s+\d+..., I suppose
  4015      jason     my ($self,$qualstr) = @_;
4015 jason # why the CORE?? -- (Because Bio::PrimarySeqI namespace has a 4015 jason # length method, you have to qualify
  4015      jason     #                    which length to use)
4015 jason return 0 if (!defined $qualstr || CORE::length ($qualstr) <= 0);
  4015      jason     return 1 if( $qualstr =~ /\d/);
  4015      jason
  4015      jason     return 0;
  2705  matsallac }


jhannah@klab:~/src/bioperl-live$ svn log -vr4015
------------------------------------------------------------------------
r4015 | jason | 2002-05-30 16:38:18 -0500 (Thu, 30 May 2002) | 2 lines
Changed paths:
   M /bioperl-live/trunk/Bio/Seq/PrimaryQual.pm

prettier, less chatty code - better logic for setting qual() data
------------------------------------------------------------------------
=====================================================

Perhaps back in 2002 Perls length() was ambiguous, but in Perl 5.8.8 I can't get it to break no matter what I try.

=====================================================
package ONE;
sub length { die };

package TWO;
use base ONE;
sub new { return bless {} };
sub length { die };

package main;
my $two = TWO->new();
print length("xxxxxxxx");
sub length { die };
=====================================================

So I guess I can go back to never worrying about or using CORE:: (a reserved Perl namespace, apparently)...

j