http://qs1969.pair.com?node_id=279798


in reply to Search through directories

If it had worked, how was your single scalar going to hold them all? And how was opendir going to open them all at once? And how were they all going to be associated with a single directory handle? One way or the other, you'll need to loop over them. That said, read perldoc -f glob for an easy way to get that to expand. You'll want to use it something like this:

for ( glob '/usr/home/*/logs' ) { # open the dir - handle errors # do stuff... }

-sauoq
"My two cents aren't worth a dime.";