add use strict; use warnings to modules, just to be sure
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Plugin / CompletionDriver / INC.pm
index d1aa4b3..a29ff8a 100644 (file)
@@ -1,12 +1,15 @@
+use strict;
+use warnings;
 package Devel::REPL::Plugin::CompletionDriver::INC;
 use Devel::REPL::Plugin;
 use File::Next;
 use File::Spec;
-use namespace::clean -except => [ 'meta' ];
+use namespace::autoclean;
 
-with qw(
-  Devel::REPL::Plugin::Completion
-);
+sub BEFORE_PLUGIN {
+    my $self = shift;
+    $self->load_plugin('Completion');
+}
 
 around complete => sub {
   my $orig = shift;
@@ -75,7 +78,7 @@ around complete => sub {
   my $add_recursively;
   $add_recursively = sub {
     my ($path, $iteration, @more) = @_;
-    opendir((my $dirhandle), $path);
+    opendir((my $dirhandle), $path) || return;
     for (grep { !$ignored{$_} } readdir $dirhandle)
     {
       my $match = $_;