Path::IsDev::Role::Heuristic::RegexpFile - Positive Heuristic when a path has a child file matching an expression
version 0.6.0
package Some::Heuristic; use Role::Tiny::With; with 'Path::IsDev::Role::Heuristic::RegexpFile'; # Match if $PATH contains a child like $PATH/.bashrc or $PATH/.bash_profile sub basename_regexp { return qr/ \A [.] bash/xism; } 1;
basename_regexp
Consuming classes must provide this method.
returns : a regexp ref that will be matched on all of $PATH->children's $_->basename
matches
Implements matches for Path::IsDev::Role::Heuristic
Path::IsDev::Role::Heuristic
if ( $class->matches($result_object) ) { # one of the items in $result_object->path->children matched $class->basename_regexp # $result_object has been modified to reflect that # _debug has been done where relevant } else { # no matches # $result_object has been modified with diagnostic data # _debug has been done where relevant }
Kent Fredric <kentfredric@gmail.com>
This software is copyright (c) 2013 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.
To install Path::IsDev, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Path::IsDev
CPAN shell
perl -MCPAN -e shell install Path::IsDev
For more information on module installation, please visit the detailed CPAN module installation guide.