develooper Front page | perl.perl5.porters | Postings from July 2003

isa(UNIVERSAL)?

Thread Next
From:
Tony Bowden
Date:
July 17, 2003 10:21
Subject:
isa(UNIVERSAL)?
Message ID:
20030717172100.GA28707@soto.kasei.com

Further to Perrin's bug report of
  http://bugs6.perl.org/rt2/Ticket/Display.html?id=3284

I did some playing, and discovered that this isn't actually a problem
with Class::Struct, per se. Consider the following test case:

	#!/usr/bin/perl -w
	use strict;
	use Test::More tests => 4;

	package Foo;
	sub new { bless {}, shift };

	package main;

	my $foo = Foo->new;

	my @isa = @Foo::ISA; ### PROBLEM ###

	for (1..2) {
		ok $foo->isa('Foo'), "Foo isa FOO";
		ok $foo->isa('UNIVERSAL'), "Foo isa UNIVERSAL";
	}


If the PROBLEM line is commented out, the test, as would be expected,
passes.

However, with the PROBLEM line in force, the second check that the
object isa UNIVERSAL fails ...

This implies its a much more deep rooted bug than the original report
would imply ...

Tony


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About