in reply to Module installed Path
use strict; use Pod::Simple::Search; use constant DEBUG => 0; for (qw(CGI.pm File::PathInfo HTML/Template.pm Smart::Comments)){ my $name = $_; my $returned = lookup_as_perl($name); print " ARG: $name = $returned\n"; } sub lookup_as_perl { my $arg_name = shift; print STDERR "lookup_as_perl() $arg_name, " if DEBUG; $arg_name=~s/^\/+//; # take out leading slashes $arg_name=~s/\/+/\:\:/g; $arg_name=~s/\.html$|\.pod$|\.pm$//; $arg_name=~s/\/+/\:\:/g; print STDERR "cleaned to $arg_name, " if DEBUG; #can we find this? my $search = Pod::Simple::Search->new; my $result = $search->find($arg_name); $result ||= 0; print STDERR "result = $result\n" if DEBUG; return $result; } # returns ... #[betti@mescaline cgihelp]# perl test.pl # ARG: CGI.pm = /usr/lib/perl5/5.8.8/CGI.pm # ARG: File::PathInfo = /usr/lib/perl5/site_perl/5.8.8/File/PathInfo.p +m # ARG: CGI::Carp = /usr/lib/perl5/5.8.8/CGI/Carp.pm # ARG: Smart::Comments = /usr/lib/perl5/site_perl/5.8.8/Smart/Comments +.pm # ARG: HTML/Template.pm = /usr/lib/perl5/site_perl/5.8.8/HTML/Template +.pm
|
---|