Commits

Anonymous committed 0ea049d

Extracted a method - _set_up_dir.

  • Participants
  • Parent commits 48da242

Comments (0)

Files changed (2)

lib/File/Find/Object.pm

     my @files;
     if (!opendir($handle, $current->_dir_as_string()))
     {
-        # Handle this error gracefully.        
+        # Handle this error gracefully.
     }
     else
     {
         @files = (sort { $a cmp $b } File::Spec->no_upwards(readdir($handle)));
         closedir($handle);
     }
-    
-    $current->_files(
-        [ @files ]
-    );
-    $current->_traverse_to(
-        [ @files ]
-    );
-    
-    $current->_mystat();
 
-    return $current->_open_dir_ret(1);
+    return $current->_set_up_dir(\@files);
 }
 
 sub set_traverse_to

lib/File/Find/Object/Base.pm

     }
 }
 
+sub _set_up_dir
+{
+    my $self = shift;
+    my $files = shift;
+
+    $self->_files(
+        [ @$files ]
+    );
+    $self->_traverse_to(
+        [ @$files ]
+    );
+    
+    $self->_mystat();
+
+    return $self->_open_dir_ret(1);
+}
+
 1;
 
 =head1 NAME