Stories
Slash Boxes
Comments
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by kasei (2524) on 2002.07.19 2:06 (#10835) Homepage Journal

    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') );

    :)