NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Yes! (Score:1)
Looks good. Grouping in the search clause might be awkward syntactically, but for fairly simple stuff, I like it. You might also provide a way to provide a code block that returns a boolean for custom stuff; So, adding to your example, try looking for smallish mp3s that have some specific ID3 tag:
my @found = NewFind->name( '*.mp3' )->type( 'file' )->size( '<1000K' )->custom( sub { ...search for id3 tags here... } )->find( '.' );
"custom" is probably the wrong name for it, but (hopefully) you understand what I'm getting at.
Come to think of it, the search for mp3s OR oggs would be easy with Q::S:
my $f = NewFind->type( 'file' )->name( any('*.mp3', '*.ogg') );Reply to This