File::F...cedural(3)
π File::Find::Rule::Procedural(3) β like, the whole vibe
okay so bestie, you're looking at File::Find::Rule::Procedural(3) from the User Contributed Perl Documentation and honestly? it's a little gem π it's the cute procedural glow-up of File::Find::Rule, no cap.
β¨ NAME β¨
File::Find::Rule::Procedural β it's literally File::Find::Rule's procedural interface, iykyk π
πΈ SYNOPSIS πΈ
use File::Find::Rule;
# find all .pm files, procedurally
my @files = find(file => name => '*.pm', in => \@INC);
that's it. that's the whole mood. look at her go π¦
π DESCRIPTION π
so besides the regular object-oriented interface (the main character), File::Find::Rule also hands you two subroutines to play with. two! π«Ά
π find( @clauses ) and rule( @clauses )
both find and rule can invoke any methods that the OO version has. and yeah β rule is a straight-up synonym for find, they're the same thing, twins fr fr π―ββοΈ
if you wanna pass more than one value to a clause, you do it with an anonymous array, like so:
my $finder = find( name => [ '*.mp3', '*.ogg' ] );
find and rule both return a File::Find::Rule instanceβ¦ unless one of the arguments is in, in which case it returns a list of things that match the rule. plot twist β¨
my @files = find( name => [ '*.mp3', '*.ogg' ], in => $ENV{HOME} );
β οΈ okay this part is lowkey important: in will be the last clause evaluated, so this next bit of code searches for mp3s regardless of size. yeah. the size clause? never gets a turn π the processing literally stops before it.
my @files = find( name => '*.mp3', in => $ENV{HOME}, size => '<2k' );
^
|
Clause processing stopped here ----/
π¦ inverting a rule with !
you can also invert a single rule by prefixing it with ! π
like this:
# large files that aren't videos
my @files = find( file =>
'!name' => [ '*.avi', '*.mov' ],
size => '>20M',
in => $ENV{HOME} );
big files only, and absolutely no videos allowed. we stan a picky queen π
π AUTHOR π
Richard Clamp <richardc@unixbeard.net> β ty for your service bestie π«‘π
β COPYRIGHT β
Copyright (C) 2003 Richard Clamp. All Rights Reserved.
this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself π§
π₯ SEE ALSO π₯
File::Find::Ruleβ go check out the OO one, she's iconic too π
and that's the whole page, bestie! this was File::F...cedural(3) from perl v5.42.0, dated 2025-06-11 β mwah, go find some files ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-File-Find-Rule 0.350.0-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms