Path::IsDev::Result(3pm)

Path::IsDev::Result3pm

Result container

Usage

    use Path::IsDev::Result;
    my $result = Path::IsDev::Result->new( path => '/some/path/that/exists' ):
    if ( $heuristcset->matches( $result ) ) {
        print Dumper($result);
    }

Version

version 1.001003

Overview

This is a reasonably new internal component for Path::IsDev.

Its purpose is to communicate state between internal things, and give some sort of introspectable context for why things happened in various places without resorting to spamming debug everywhere.

Now instead of turning on debug, as long as you can get a result, you can inspect and dump that result at the point you need it.

Methods

"build"

"add_reason"

Call this method from a heuristic to record checking of the heuristic and the relevant meta-data.

    $result->add_reason( $heuristic, $matchvalue, $reason_summary, \%contextinfo );

For example:

    sub Foo::matches  {
        my ( $self , $result_object ) = @_;
        if ( $result_object->path->child('bar')->exists ) {
            $result_object->add_reason( $self, 1, "child 'bar' exists" , {
                child => 'bar',
                'exists?' => 1,
                child_path => $result_object->path->child('bar')
            });
            $result_object->result(1);
            return 1;
        }
        return;
    }

Note that here, $matchvalue should be the result of the relevant matching logic, not the global impact.

For instance, "excludes" compositions should still add reasons of "$matchvalue == 1", but they should not set "$result_object->result(1)". ( In fact, setting "result" is the job of the individual heuristic, not the matches that are folded into it )

Attributes

"path"

"result"

"reasons"

Releases

7 releases since Debian 8 (Jessie); the text changed 3 times.

  1. 8–9
  2. 10–11
  3. 12–13
  4. Arch

Author

Kent Fredric <[email protected]>

From perl-path-isdev 1.001003-10 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.