in reply to reading from directory
opendir DIR, "MainDir" or die ""; while( $file = readdir(DIR) ) { #do whatever you want to the file } closedir DIR;
One thing to note, this method includes directory names.
If you just want to grep for a string in all .cpp files in the current directory, try using globs (this is still magic to me, btw) like so:
while( $file = <*.cpp> ) { #do something to the file }
~CubicSpline
"No one tosses a Dwarf!"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: reading from directory
by moodster (Hermit) on Aug 20, 2002 at 08:32 UTC |