Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Grep on a list of files in directory

by Dru (Hermit)
on Oct 29, 2010 at 19:13 UTC ( #868387=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://868387]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2018-07-19 15:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (411 votes). Check out past polls.

    Notices?