Commits

Anonymous committed ccc1ca1

Changed ->{currentfile} to ->_curr_file() (an accessor).

Comments (0)

Files changed (1)

lib/File/Find/Object.pm

     return $self->{_dir_stack};
 }
 
+sub _curr_file
+{
+    my $self = shift;
+
+    if (@_)
+    {
+        $self->{_curr_file} = shift;
+    }
+
+    return $self->{_curr_file};
+}
+
 sub _top
 {
     my $self = shift;
 sub _movenext_with_current
 {
     my $self = shift;
-    if ($self->_current->{currentfile} = 
-        shift(@{$self->_father($self->_current)->{_files}})
-       )
+    if ($self->_current->_curr_file(
+            shift(@{$self->_father($self->_current)->{_files}})
+       ))
     {
         $self->_current->{_action} = {};
         return 1;
 
     $self->{ind} > @{$self->{files}} and return;
     $self->{ind}++;
-    $self->{currentfile} = ${$self->{files}}[$self->{ind}];
+    $self->_curr_file(${$self->{files}}[$self->{ind}]);
     $self->{_action} = {};
     1;
 }
 sub _process_current {
     my ($self) = @_;
    
-    $self->{currentfile} or return 0;
+    $self->_curr_file() or return 0;
 
     $self->_top->isdot($self) and return 0;
     $self->_top->filter($self) or return 0;  
 {
     my ($self, $current) = @_;
 
-    my $file = $current->{currentfile};
+    my $file = $current->_curr_file();
 
     return ($file eq ".." || $file eq ".");
 }
 
     if ($self eq $current)
     {
-        return $self->{currentfile};
+        return $self->_curr_file;
     }
 
     my $p = $self->_father($current)->{dir};
     $p =~ s!/+$!!; #!
-    $p .= '/' . $current->{currentfile};
+    $p .= '/' . $current->_curr_file;
 
     return $p;
 }