9 die "usage: nextalyzer Some::Class" unless $class;
13 die "Error using $class: $@" if $@;
15 my @path = reverse Class::ISA::super_path($class);
22 foreach my $super (@path) {
26 my $file_path = $INC{$file};
27 die "Couldn't get INC for $file, super $super" unless $file_path;
28 #warn "$super $file $file_path";
29 open IN, '<', $file_path;
35 while (my $line = <IN>) {
37 ($ws, $in_sub) = ($line =~ /^(\s*)sub (\S+)/);
40 if ($line =~ /^$ws\}/) {
42 push(@overloads, $in_sub);
44 push(@provides, $in_sub);
51 $uses_next++ if ($line =~ /\-\>NEXT/);
54 foreach (@overloads) {
55 push(@warnings, "Method $_ overloaded in $class but not yet provided")
57 push(@{$overloaded{$_}}, $super);
59 $provided{$_} = $super for @provides;
60 print "Class $super:\n";
61 print "Provides: @provides\n";
62 print "Overloads: @overloads\n";
67 print join("\n", @warnings);
69 foreach my $o (keys %overloaded) {
70 my $pr = $provided{$o} || "**NEVER**";
71 print "Method $o: ".join(' ', reverse @{$overloaded{$o}})." ${pr}\n";