Link to home
Start Free TrialLog in
Avatar of matgold
matgold

asked on

file listing excluding directory

chdir "d:/temp";
@files = grep { ! /\./ } glob "abc*" ;

with the code above, how do I exclude sub-directory
ASKER CERTIFIED SOLUTION
Avatar of jmcg
jmcg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of manav_mathur
manav_mathur

and you could also merge both the grep's into one.
Avatar of matgold

ASKER

basically, I want a list of all files without the extention and make sure is not a directory.

thanks
Avatar of ozo
#with
grep { !/^\./ } glob "abc*"
#the grep will always be true
Ozo's right, of course! What was I thinking?
Avatar of matgold

ASKER

are you saying I don't need   "grep { ! -d } "   ?
No, that's the part the eliminates the subdirectories.