Make sure you are in the correct directory, or that each item of @list explicitly specifies the entire path to the files, or directories. IMHO, the best way to do something like this is to call the function chdir to the "root" directory of the files you want test, with all of your directory/file names relative to your "root". Nam On Thu, 25 Sep 1997, Bill Hutten wrote: > > I'm having a problem that's almost certainly attributable to my > stupidity, and i'd appreciate the lists' help: > > ...given the following: > > > foreach $item (@list) { > if (-d $item) { > print "directory: $item\n"; > }else{ > print "$item\n"; > } > } > > ...where we have a list of files & directories in @list, why does the > "-d" test never evalate to true? If I use "-e" to test for existance it > never works either, leading me to conclude that 1) those operators are > broken or b) i'm an idiot. > > > ...anyone care to tell me if it's (a) or (b)? ...and yes, this is my > first day with Perl. > > > > thanks > > - bill > > > ---------------------------------------------- > Bill Hutten db+www bhutten@cochran.com > Cochran Interactive > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Nam-June Joe namjj@eclipse.net US Applications Develpment njoe@sbi.com Salomon Brothers, Inc. namjj@seas.upenn.edu University of Pennsylvania '96 http://www.eclipse.net/~namjj/ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch