in reply to Re^2: Class::Std problem
in thread Class::Std problem

Sorry, but something you said isn't true.

>perl -we"@hierarchy = qw(EEBL::League::Schedule); () = sort { $a->isa +($b) ? -1 : $b->isa($a) ? +1 : 0 } @hierarchy;" >perl -we"@hierarchy = qw(EEBL::Team EEBL EEBL::Config); () = sort { $ +a->isa($b) ? -1 : $b->isa($a) ? +1 : 0 } @hierarchy;" >

According to you, code that isn't even executed is issuing a run-time warning.

>perl -we"() = sort { die } 1" >perl -we"() = sort { die } 1,2" Died at -e line 1. >

Find what and you found your problem. The most likely by far is that the content of @hierarchy isn't what you think it is.

I used Data::Dumper to print out @hierarchy.

Please provide the output. Remember to use Dumper(\@hierarchy) and not Dumper(@hierarchy). Flattening the array makes the output ambiguous.

Replies are listed 'Best First'.
Re^4: Class::Std problem
by Herkum (Parson) on Jan 19, 2009 at 14:26 UTC

    Here, is the output that I got from debugging. (Count was used to show the number of elements in the array, so that no undefined elements are sneaking in).

    Dumper $VAR1 = [ 'EEBL::League::Prospect', 'EEBL', 'EEBL::Config' ]; Count: 3 Dumper $VAR1 = [ 'EEBL::Team', 'EEBL', 'EEBL::Config' ]; Count: 3 Can't call method "isa" on an undefined value at /usr/local/share/perl +/5.8.8/Cla + ss/Std.pm line 228. Dumper $VAR1 = [ 'EEBL::Team', 'EEBL', 'EEBL::Config' ]; Count: 3 (in cleanup) Can't call method "isa" on an undefined value at +/usr/local + /share/perl/5.8.8/Class/Std.pm line 228. Dumper $VAR1 = [ 'EEBL::League::Schedule' ]; Count: 1

    I have used Class::Std a lot, and this is the first time I came across this sort of error. I think it just might be a interpreter error because this program was working on another box. I was hoping someone would have any idea of how to work around it without me having to reinstall/update Perl on the machine.

      The guesswork is becoming tedious. Please provide a minimal piece of code that produces the problem.