John W. Krahn <[EMAIL PROTECTED]> wrote:
:
: > From: "Charles K. Clarkson" <[EMAIL PROTECTED]>
:
: > > sub IsEmptyDir {
[snip]
: > > return $count ? 0 : 1;
:
: You could just return $count; which will do the right thing.
We are testing for an empty condition. When
the count is 0 the function should return a 'true'
value meaning "true the directory is empty". If
we returned $count empty directories would return
false and directories with content would return
true. Though it appears I could have written:
return ! $count;
Or the 'golf'ish:
return ! grep ! /^\.{1,2}$/, readdir $dh;
HTH,
Charles K. Clarkson
--
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]