Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.unix.shell > #21489
| From | merlyn@stonehenge.com (Randal L. Schwartz) |
|---|---|
| Newsgroups | comp.unix.shell |
| Subject | Re: find2perl |
| References | <eli$2105101745@qaz.wtf> <86zgwy66yu.fsf@red.stonehenge.com> <slrns9r8ip.2c69.naddy@lorvorc.mips.inka.de> <s7p0j3$t1kh$1@news.xmission.com> |
| Message-ID | <86k0nz62z4.fsf@red.stonehenge.com> (permalink) |
| Organization | Stonehenge Consulting Services; Portland, Oregon, USA |
| Date | 2021-05-15 15:34 -0700 |
>>>>> "Kenny" == Kenny McCormack <gazelle@shell.xmission.com> writes:
Kenny> So, for the benefit of those of us who know next-to-nothing about Perl (and
Kenny> prefer to remain that way), how (in simplest terms) do I go about
Kenny> installing find2perl on this particular system?
Kenny> Also, any idea why it was taken out (why it is no longer part of
Kenny> Perl) ?
There's also my File::Finder in the CPAN which can build the equivalent
of nearly any find(1) expression using method chaining.
In this case, it'd be:
use File::Finder;
File::Finder
->type('d')
->eval('-f "SENTINEL-1" and -f "SENTINEL-2"')
->print
->in(@ARGV);
Or instead of printing them, you can gather them as an array:
use File::Finder;
my @list = File::Finder
->type('d')
->eval('-f "SENTINEL-1" and -f "SENTINEL-2"')
->in(@ARGV);
File::Finder was fun to write. And I essentially used a FORTH-like
"builds...does" strategy for the method chaining. And the expression
evaluator supports and/or/not/parens. So for something in find(1) like:
-condition -and -not \( -this -or -that \)
you could write it as:
condition->and->not->left->this->or->that->right
print "Just another Perl hacker,"; # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Dart/Flutter consulting, Technical writing, Comedy, etc. etc.
Still trying to think of something clever for the fourth line of this .sig
Back to comp.unix.shell | Previous | Next — Previous in thread | Find similar | Unroll thread
finding directories based on files within? Eli the Bearded <*@eli.users.panix.com> - 2021-05-10 22:13 +0000
Re: finding directories based on files within? Spiros Bousbouras <spibou@gmail.com> - 2021-05-13 02:38 +0000
Re: finding directories based on files within? Martijn Dekker <martijn@inlv.demon.nl> - 2021-05-13 04:50 +0200
Re: finding directories based on files within? Ed Morton <mortonspam@gmail.com> - 2021-05-13 07:20 -0500
Re: finding directories based on files within? Ed Morton <mortonspam@gmail.com> - 2021-05-13 09:04 -0500
Re: finding directories based on files within? Axel Reichert <mail@axel-reichert.de> - 2021-05-13 14:56 +0200
Re: finding directories based on files within? Ed Morton <mortonspam@gmail.com> - 2021-05-13 08:44 -0500
Re: finding directories based on files within? Axel Reichert <mail@axel-reichert.de> - 2021-05-13 21:09 +0200
Re: finding directories based on files within? merlyn@stonehenge.com (Randal L. Schwartz) - 2021-05-13 07:31 -0700
Re: finding directories based on files within? Eli the Bearded <*@eli.users.panix.com> - 2021-05-13 17:11 +0000
Re: finding directories based on files within? Christian Weisgerber <naddy@mips.inka.de> - 2021-05-13 22:04 +0000
Re: finding directories based on files within? merlyn@stonehenge.com (Randal L. Schwartz) - 2021-05-15 06:45 -0700
find2perl (Was: finding directories based on files within?) gazelle@shell.xmission.com (Kenny McCormack) - 2021-05-15 17:32 +0000
Re: find2perl Dan Espen <dan1espen@gmail.com> - 2021-05-15 13:46 -0400
Re: find2perl (Was: finding directories based on files within?) Christian Weisgerber <naddy@mips.inka.de> - 2021-05-15 20:17 +0000
Re: find2perl (Was: finding directories based on files within?) gazelle@shell.xmission.com (Kenny McCormack) - 2021-05-16 13:06 +0000
Re: find2perl merlyn@stonehenge.com (Randal L. Schwartz) - 2021-05-15 15:34 -0700
csiph-web