| Module-Filename documentation | Contained in the Module-Filename distribution. |
Module::Filename - Returns the filename for a given module
use Module::Filename;
my $filename=Module::Filename->new->filename("strict");
my $mf=Module::Filename->new();
Returns the first filename that matches the module in the @INC path array.
my $filename=Module::Filename->new->filename("strict");
Submit to RT and email author.
Try author.
Michael R. Davis
CPAN ID: MRDVT
STOP, LLC
domain=>michaelrdavis,tld=>com,account=>perl
http://www.stopllc.com/
This program is free software licensed under the...
The BSD License
The full text of the license can be found in the LICENSE file included with this module.
pmpath, Module::Info constructor=>new_from_module, method=>file, Module::InstalledVersion property=>"dir", Module::Locate method=>locate, Module::Util method=>find_installed
| Module-Filename documentation | Contained in the Module-Filename distribution. |
package Module::Filename; use strict; use Path::Class qw{file}; our $VERSION = '0.01';
sub new { my $this = shift(); my $class = ref($this) || $this; my $self = {}; bless $self, $class; $self->initialize(@_); return $self; }
sub initialize { my $self = shift(); %$self=@_; }
sub filename { my $self=shift; my $module=shift or die("Error: Module name required."); my $file=file(split("::", $module.".pm")); my $return=undef; foreach my $path (@INC) { my $filename=file($path, $file); if (-f $filename) { $return=$filename; last; #return the first match in @INC } } return $return; }
1;