Subject: | [patch] flag constants in pmeth |
Please find attached a patch incorporating code from L<constant> to flag
routines as such. Flagging XS constants would also be nice, but C-fu is
weak.
Subject: | constant.patch |
--- /usr/local/bin/pmeth 2009-12-16 20:21:25.000000000 -0500
+++ pmeth 2009-12-16 21:21:09.000000000 -0500
@@ -24,6 +24,8 @@
return;
}
foreach $name ( sort keys %{ $module . "::" } ) {
+ print '[constant] ' if declared($module . "::" . $name);
+
if (defined &{ $module . "::" . $name } ) {
print "[overridden] " if $got_def{$name}++;
if (@indirect) {
@@ -40,6 +42,15 @@
}
}
+sub declared ($) {
+ use constant 1.01; # don't omit this!
+ my $name = shift;
+ $name =~ s/^::/main::/;
+ my $pkg = caller;
+ my $full_name = $name =~ /::/ ? $name : "${pkg}::$name";
+ $constant::declared{$full_name};
+}
+
exit ($errors != 0);
__END__
@@ -73,6 +84,9 @@
[overridden] new via IO::Handle
+Constants declared via L<constant> have a leading "[constant]" added
+to the output, but XS C<define>'s are not yet so flagged.
+
=head1 EXAMPLES
$ pmeth IO::Socket