#!/usr/bin/perl -w ########################################### # wpm -- Determine where a perl module is installed # Mike Schilli, 2002 (m@perlmeister.com) ########################################### use File::Spec::Functions; use Pod::Usage; use warnings; use strict; our $VERSION = "1.00"; our $CVSVERSION = '$Revision: 1.3 $'; pod2usage "usage: $0 Module" unless defined $ARGV[0]; my $subpath = catfile(split "::", $ARGV[0]) . ".pm"; foreach my $path (@INC) { my $fullpath = catfile($path, $subpath); if(-e $fullpath) { print "$fullpath\n"; last; } } =head1 NAME wpm - Figure out where a perl module is installed =head1 DOWNLOAD _SRC_HERE_ =head1 SYNOPSIS wpm Module =head1 DESCRIPTION If you're using a module from CPAN which seemingly misbehaves, your best chances are to check its source code. But where is it installed? If you take C, for example, would you know that it's located in C? C takes a module name as a parameter and quickly determines where it is installed by walking the @INC array. The module name is expected in the same format in which Perl's C command expects them -- I the C<*.pm> postfix and with double-colons (C<::>) as hierarchy separators. =head1 EXAMPLE To determine where the popular module C has been installed, just run wpm ExtUtils::MakeMaker on the command line and you'll get something like /usr/lib/perl5/5.6.0/ExtUtils/MakeMaker.pm =head1 LEGALESE Copyright 2002 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR Mike Schilli Em@perlmeister.comE