Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Grep on a list of files in directory

by Dru (Hermit)
on Oct 29, 2010 at 19:13 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://868387]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-03-28 22:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found