in reply to File::Find::Rule grep()

TIMTOWTDI. I'm using File::Find::Rule instead of File::Find for its globbing capabilities (although File::Find::Rule cannot handle multiple patterns in a glob string).

Replies are listed 'Best First'.
Re^2: File::Find::Rule grep()
by Anonymous Monk on Jan 26, 2013 at 08:11 UTC

    TIMTOWTDI. I'm using File::Find::Rule instead of File::Find for its globbing capabilities (although File::Find::Rule cannot handle multiple patterns in a glob string).

    Huh? Sure it can, it uses Text::Glob#glob_to_regex

      $ md tmp $ cd tmp $ echo > asdf $ echo > asdg $ echo > asdh $ echo > bsdf $ echo > bsdg $ echo > bsdh $ echo > csdh $ echo > csda $ echo > csdd $ findrule . -file -name *h asdh bsdh csdh $ findrule . -file -name a* asdf asdg asdh $ findrule . -file -name b* bsdf bsdg bsdh $ findrule . -file -name *h asdh bsdh csdh $ findrule . -file -name {a*,b*,*h} asdf asdg asdh bsdf bsdg bsdh csdh $ cd .. $ findrule tmp -file -name {{a,b}*,*h} tmp/asdf tmp/asdg tmp/asdh tmp/bsdf tmp/bsdg tmp/bsdh tmp/csdh