On Thu, 3 Apr 2003, Daniel Gross wrote: > Hello, > > I am trying to find all files that have zero size, but it doesn't work > -- why? > > > my @tmpArray = glob("$dirName/*.tif"); > my @zeroFiles = getZeroSizeTiffs(@tmpArray); > > sub getZeroSizeTiffs { > my (@tiffFiles) = @_; > > my @zeroFiles = grep { -z $_ } @tiffFiles; > > return @zeroFiles; > } >
My guess is that the $dirName is giving you problems. Since you glob'ed with a directory name, my guess is that the list returned by the glob was just filenames, without the directory prepended. Try this for your grep and see if it works: my @zeroFiles = grep { -z "$dirName/$_" } @tiffFiles; **** [EMAIL PROTECTED] <Carl Jolley> **** All opinions are my own and not necessarily those of my employer **** _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs