in reply to Grep on a list of files in directory

A simpler (IMHO) alternative to using grep here is to use glob
@xml_files = glob($start_dir . '\' . '*.xml');
YMMV

Thanks,
Dru

Perl, the Leatherman of Programming languages. - qazwart

Replies are listed 'Best First'.
Re^2: Grep on a list of files in directory
by iphone (Beadle) on Nov 01, 2010 at 00:20 UTC

    If i use as suggested i am getting the following syntax error.Can you pls help?

    syntax error at xml.pl line 32, near "*." Bad name after xml' at xml.pl line 32.
      Escape the backslash:
      @xml_files = glob($start_dir . '\\' . '*.xml');