From 0a3f85d5bf89de4d9a9ab498ecffac90c87e34ea Mon Sep 17 00:00:00 2001 From: Jens Luedicke Date: Sat, 9 Mar 2013 13:27:48 +0100 Subject: [PATCH] M: Renamed filesInDir() to count(). --- lib/File/DirWalk.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/File/DirWalk.pm b/lib/File/DirWalk.pm index ecbc0ca..51e6169 100644 --- a/lib/File/DirWalk.pm +++ b/lib/File/DirWalk.pm @@ -39,7 +39,7 @@ sub new { $self->{depth} = 0; $self->{depthCount} = 0; - $self->{filesInDir} = 0; + $self->{count} = 0; # $self->{customResponse} = {}; @@ -119,9 +119,9 @@ sub currentBasename { return $self->{currentBasename}; } -sub filesInDir { +sub count { my ($self) = @_; - return $self->{filesInDir}; + return $self->{count}; } sub walk { @@ -153,7 +153,7 @@ sub walk { my @dir_contents = readdir $dirh; @dir_contents = File::Spec->no_upwards(@dir_contents); - $self->{filesInDir} = scalar @dir_contents; + $self->{count} = scalar @dir_contents; ++$self->{depthCount}; if ((my $r = $self->{onDirEnter}->($path)) != SUCCESS) { @@ -328,9 +328,9 @@ Returns the current base name of the current path: return SUCCESS; }); -=item filesInDir +=item count -Returns the number of files wthin the current directory. +Returns the number of elements wthin the current directory. Excludes . and .. =item walk($path)