File::...edural(3pm)
π File::Find::Object::Rule::Procedural β the vibe-y manual β¨
okay so bestie, this is the page for File::Find::Object::Rule::Procedural, part of the User Contributed Perl Documentation, section 3pm. it's the procedural lil' side of the File::Find::Object::Rule house and it's genuinely so useful, no cap π«Ά
πΈ VERSION πΈ
version 0.0313 β yeah she's got a version number, she's official π
β¨ SYNOPSIS β¨
use File::Find::Object::Rule;
# find all .pm files, procedurally
my @files = find(file => name => '*.pm', in => \@INC);
look at that. three clauses and you're finding files. it's giving effortless. it's giving main character energy π«
π¦ DESCRIPTION π¦
so File::Find::Object::Rule isn't just the object-oriented interface you already know and love β she also gives you two subroutines to play with. two!! a whole duo. the way that she did that π
find( @clauses )rule( @clauses )
find and rule can be used to invoke any methods available to the OO version. literally any of them. and rule is just a synonym for find β same energy, different name, iconic behaviour honestly.
π passing more than one value to a clause
if you wanna hand more than one value to a single clause, you do it with an anonymous array like so:
my $finder = find( name => [ '*.mp3', '*.ogg' ] );
the square brackets are doing the heavy lifting there. she's carrying the whole squad π§
π what do these even return
find and rule both return a File::Find::Object::Rule instance β unless one of the arguments is in, in which case it returns a list of things that match the rule. plot twist!! but a good one.
my @files = find( name => [ '*.mp3', '*.ogg' ], in => $ENV{HOME} );
okay now listen, this next bit is important, so lean in π
Please note that in will be the last clause evaluated. so this code here is gonna search for mp3s regardless of size β the size clause literally never gets a turn, bestie, she got cut off:
my @files = find( name => '*.mp3', in => $ENV{HOME}, size => '<2k' );
^
|
Clause processing stopped here ------/
see the lil arrow? that's where clause processing stopped. rest in peace size => '<2k' π the order you write your clauses in matters, fr fr.
π inverting a single rule
you can also invert a single rule by prefixing it with ! β like so:
# large files that aren't videos
my @files = find( file =>
'!name' => [ '*.avi', '*.mov' ],
size => '>20M',
in => $ENV{HOME} );
large files that aren't videos. the ! is doing a lil "not" for you and honestly? slay. the vibes are immaculate π
π AUTHOR π
Richard Clamp <richardc@unixbeard.net>
π 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::Object::Rule
π SUPPORT π
π Websites
The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.
- MetaCPAN β A modern, open-source CPAN search engine, useful to view POD in HTML format. <https://metacpan.org/release/File-Find-Object-Rule>
- RT: CPAN's Bug Tracker β The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. <https://rt.cpan.org/Public/Dist/Display.html?Name=File-Find-Object-Rule>
- CPANTS β The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution. <http://cpants.cpanauthors.org/dist/File-Find-Object-Rule>
- CPAN Testers β The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions. <http://www.cpantesters.org/distro/F/File-Find-Object-Rule>
- CPAN Testers Matrix β The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. <http://matrix.cpantesters.org/?dist=File-Find-Object-Rule>
- CPAN Testers Dependencies β The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. <http://deps.cpantesters.org/?module=File::Find::Object::Rule>
π Bugs / Feature Requests
Please report any bugs or feature requests by email to bug-file-find-object-rule at rt.cpan.org, or through the web interface at <https://rt.cpan.org/Public/Bug/Report.html?Queue=File-Find-Object-Rule>.
You will be automatically notified of any progress on the request by the system. yes bestie, the system keeps you posted, that's a nice lil touch π«Ά
π§ Source Code
The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)
<https://github.com/shlomif/http://bitbucket.org/shlomif/perl-file-find-object-rule>
git clone git://github.com/shlomif/http://bitbucket.org/shlomif/perl-file-find-object-rule.git
(yes those URLs are exactly as written, i'm not touching them, i'm not "fixing" them, i would never π )
π AUTHORS π
- Richard Clamp
<richardc@unixbeard.net> - Andy Lester
andy@petdance.com.
π BUGS π
Please report any bugs or feature requests on the bugtracker website <https://github.com/shlomif/http://bitbucket.org/shlomif/perl-file-find-object-rule/issues>
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. it helps so much, please do it, i am begging π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2021 by Richard Clamp.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie!! π generated with perl v5.32.1, dated 2021-09-04, mwah π go find some files, you got this, periodt. πβ¨
π¦ where this page comes from
- debian bookworm: libfile-find-object-rule-perl 0.0313-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libfile-find-object-rule-perl 0.0313-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libfile-find-object-rule-perl 0.0313-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libfile-find-object-rule-perl 0.0313-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libfile-find-object-rule-perl 0.0313-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libfile-find-object-rule-perl 0.0313-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms