File::F...e::Perl(3)

πŸ’… File::Find::Rule::Perl(3) β€” like, the whole page, bestie

okay so real quick: this is a User Contributed Perl Documentation page, and the module it's about is File::Find::Rule::Perl. yes the header is squished to File::F...e::Perl(3) because terminals are dramatic. anyway. sit down, grab a strawberry πŸ“, let's go.


✨ NAME ✨

File::Find::Rule::Perl β€” common rules for searching for Perl things πŸͺ


πŸŽ€ SYNOPSIS πŸŽ€

use File::Find::Rule       ();
use File::Find::Rule::Perl ();

# Find all Perl files smaller than 10k
my @files = File::Find::Rule->perl_file
                            ->size('<10Ki')
                            ->in('dir');

# Locate all the modules that PAUSE will index
my @mod = File::Find::Rule->no_index
                          ->perl_module
                          ->in('My-Distribution');

like, look at that. two lines of setup and you're already slaying 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the author writes a lot of stuff that mucks with Perl files. and it always annoyed them (valid, honestly 😭) that finding "perl files" requires a moderately complex File::Find::Rule pattern.

File::Find::Rule::Perl provides methods for finding various types of Perl-related files β€” or for replicating search queries run on a distribution in various parts of the CPAN ecosystem. it's giving "I did the annoying part so you don't have to" energy πŸ‘‘


🌸 METHODS 🌸

πŸ’– perl_module

the perl_module rule locates perl modules. that is, files that are named *.pm.

this rule is equivalent to "->"file->name( '*.pm' )> and is included primarily for completeness.

πŸ’– perl_test

the perl_test rule locates perl test scripts. that is, files that are named *.t.

this rule is equivalent to "->"file->name( '*.t' )> and is included primarily for completeness.

πŸ’– perl_installer

the perl_installer rule locates perl distribution installers. that is, it locates Makefile.PL and Build.PL files. πŸ› οΈ

πŸ’– perl_script

the perl_script rule locates perl scripts.

this is any file that ends in .pl, or any files without extensions that have a perl "hash-bang" line. iykyk ⭐

πŸ’– perl_file

the perl_file rule locates all files containing Perl code. the whole squad, no cap.

this includes all the files matching the above perl_module, perl_test, perl_installer and perl_script rules. so basically it's the group chat and those four are the members 🫢

πŸ’– no_index

# Provide the rules directly
$rule->no_index(
    directory => [ 'inc', 't', 'examples' ],
    file      => [ 'Foo.pm', 'lib/Foo.pm' ],
);

# Provide a META.yml to use
$rule->no_index( 'META.yml' );

# Provide a dist root directory to look for a META.yml in
$rule->no_index( 'My-Distribution' );

# Automatically pick up a META.yml from the target directory
$rule->no_index->in( 'My-Distribution' );

the no_index method applies a set of rules as per the no_index section in a META.yml file. four whole ways to feed it, pick your fighter πŸ’…


πŸ”₯ SUPPORT πŸ”₯

bugs should always be submitted via the CPAN bug tracker:

<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Find-Rule-Perl>

for other issues, contact the maintainer 🫑


πŸ‘‘ AUTHOR πŸ‘‘

Adam Kennedy <adamk@cpan.org>


🌈 SEE ALSO 🌈

<http://ali.as/>, File::Find::Rule, File::Find::Rule::PPI


Copyright 2006 - 2012 Adam Kennedy.

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

the full text of the license can be found in the LICENSE file included with this module.


ngl, that's the whole thing. no skips, no cuts, every flag and file and URL accounted for. ate and left no crumbs πŸ“

so yeah β€” that was File::F...e::Perl(3) from perl v5.42.0, dated 2022-04-06. mwah, go find some files bestie πŸ’‹βœ¨

πŸ“¦ where this page comes from