in reply to Alternative to using system grep

There is also the quite useful module File::Find::Rule, which makes grepping files easy:

use strict; use File::Find::Rule; my @files = File::Find::Rule ->file() ->grep(qr!<value>IsFrequentlyUsed</value>!) ->in('.');

Replies are listed 'Best First'.
Re^2: Alternative to using system grep
by Aristotle (Chancellor) on Aug 18, 2004 at 12:05 UTC

    Except that will descend into subdirectories. You need a ->maxdepth(1) in there.

    Makeshifts last the longest.

Re^2: Alternative to using system grep
by synistar (Pilgrim) on Aug 18, 2004 at 14:07 UTC

    Alternately, you may also want to take a look at merlyn's File::Finder. It has a nice clean interface.

      I still don't understand why that interface is supposed to be any better than File::Find::Rule's.

      Makeshifts last the longest.

        I like it because its uses syntax that is mapped directly from the Unix find command (which is already familiar to many). It is also compatible with File::Find::Rule (see this node).

        UPDATE: added node link.