# File::Share - Extend File::ShareDir to Local Libraries - perldoc - [phpMan]

## NAME
    [File::Share](https://www.chedong.com/phpMan.php/perldoc/File%3A%3AShare/markdown) - Extend [File::ShareDir](https://www.chedong.com/phpMan.php/perldoc/File%3A%3AShareDir/markdown) to Local Libraries

## SYNOPSIS
        use [File::Share](https://www.chedong.com/phpMan.php/perldoc/File%3A%3AShare/markdown) ':all';

        my $dir = dist_dir('Foo-Bar');
        my $file = dist_file('Foo-Bar', 'file.txt');

## DESCRIPTION
    This module is a dropin replacement for [File::ShareDir](https://www.chedong.com/phpMan.php/perldoc/File%3A%3AShareDir/markdown). It supports the "dist_dir" and
    "dist_file" functions, except these functions have been enhanced to understand when the
    developer's local "./share/" directory should be used.

    NOTE: module_dist and module_file are not yet supported, because (afaik) there is no well known
    way to populate per-module share files. This may change in the future. Please contact me if you
    know how to do this.

## PROBLEM AND SOLUTION
    [Module::Install](https://www.chedong.com/phpMan.php/perldoc/Module%3A%3AInstall/markdown) has an "install_share" directive that allows you to install various files
    associated with a distribution. By convention, module authors always put these in a directory
    called "share/". However, [File::ShareDir](https://www.chedong.com/phpMan.php/perldoc/File%3A%3AShareDir/markdown) can only find files after they have been installed.
    This can be problematic when running development tests.

    [File::Share](https://www.chedong.com/phpMan.php/perldoc/File%3A%3AShare/markdown) will look for a local "share" directory, if it notices that the module corresponding
    was loaded from a development path.

    [Devel::Local](https://www.chedong.com/phpMan.php/perldoc/Devel%3A%3ALocal/markdown) gives you an easy way to use a bunch of source repositories as though their lib and
    bin directories had already been installed. "[File::Share](https://www.chedong.com/phpMan.php/perldoc/File%3A%3AShare/markdown)" lets you play along with that.

## SEE ALSO
    *   [File::ShareDir](https://www.chedong.com/phpMan.php/perldoc/File%3A%3AShareDir/markdown)

## AUTHOR
    Ingy döt Net <<ingy@cpan.org>>

## COPYRIGHT AND LICENSE
    Copyright 2011-2014. Ingy döt Net.

    This program is free software; you can redistribute it and/or modify it under the same terms as
    Perl itself.

    See <<http://www.perl.com/perl/misc/Artistic.html>>

