GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Path::FindDev(3) User Contributed Perl Documentation Path::FindDev(3)

Path::FindDev - Find a development path somewhere in an upper hierarchy.

version 0.5.2

This package is mostly a glue layer around "Path::IsDev" with a few directory walking tricks.

    use Path::FindDev qw( find_dev );

    if ( my $root = find_dev('/some/path/to/something/somewhere')) {
        print "development root = $root";
    } else {
        print "No development root :(";
    }

    my $result = find_dev('/some/path');

If a "dev" directory is found at, or above, "/some/path", it will be returned as a "Path::Tiny"

If you pass configurations to import:

    use Path::FindDev find_dev => { set => $someset };

Then the exported "find_dev" will pass that set name to "Path::IsDev".

Though you should only do this if

  • the default set is inadequate for your usage
  • you don't want the set to be overridden by %ENV

Additionally, you can call find_dev directly:

    require Path::FindDev;

    my $result = Path::FindDev::find_dev('/some/path');

Which by design inhibits your capacity to specify an alternative set in code.

Have you ever found yourself doing

    use FindBin;
    use lib "$FindBin::Bin/../../../tlib"

In a test?

Have you found yourself paranoid of file-system semantics and tried

    use FindBin;
    use Path::Tiny qw(path)
    use lib path($FindBin::Bin)->parent->parent->parent->child('tlib')->stringify;

Have you ever done either of the above in a test, only to find you've needed to move the test to a deeper hierarchy, and thus, need to re-write all your path resolution?

Have you ever had this problem for multiple files?

No more!

    use FindBin;
    use Path::FindDev qw(find_dev);
    use lib find_dev($FindBin::Bin)->child('t','tlib')->stringify;

^ Should work, regardless of which test you put it in, and regardless of what $CWD happens to be when you call it.

Kent Fredric <kentfredric@gmail.com>

This software is copyright (c) 2014 by Kent Fredric <kentfredric@gmail.com>.

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

2014-08-16 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.