END { foreach my $file (sort keys %INC) { my $module = $file ; my $located = $INC{$file} ; $module =~ s|\.pm$|| ; $module =~ s|[/\\]|::|g ; my $version ; { no strict 'refs' ; $version = ${$module.'::VERSION'} || '??' ; } ; print STDERR "$module v$version $located\n" ; } ; } ; #### END { my %myINC = () ; foreach my $file (keys %INC) { my $module = $file ; $module =~ s|\.pm$|| ; $module =~ s|[/\\]|::|g ; $myINC{$module} = $INC{$file} ; } ; foreach my $module (sort keys %myINC) { my $located = $myINC{$module} ; my $version ; { no strict 'refs' ; $version = ${$module.'::VERSION'} || '??' ; } ; print STDERR "$module v$version $located\n" ; open my $FH, "<", $located or die "failed to open $located: $!" ; while (<$FH>) { if ((m/^(?:\s+|[^#;];\s*)*?require\s+([A-Za-z]\w+(?:::\w+)*)\b/) && !exists($myINC{$1})) { printf STDERR " %5d: %s", $., $_ ; } ; } ; } ; } ;