File::PathList is a Perl module that can find a file within a set of paths (like @INC or Java classpaths).
SYNOPSIS
# Create a basic pathset
my $inc = File::PathList->new( @INC );
# Again, but with more explicit params
my $inc2 = File::PathList->new(
paths => @INC,
cache => 1,
);
# Get the full (localised) path for a unix-style relative path
my $file = "foo/bar/baz.txt";
my $path = $inc->find_file( $file );
if ( $path ) {
print "Found '$file' at '$path'n";
} else {
print "Failed to find '$file'n";
}
Many systems that map generic relative paths to absolute paths do so with a set of base paths.
For example, perl itself when loading classes first turn a Class::Name into a path like Class/Name.pm, and thens looks through each element of @INC to find the actual file.
To aid in portability, all relative paths are provided as unix-style relative paths, and converted to the localised version in the process of looking up the path.
Product's homepage
Requirements:
· Perl