From: Sartak Date: Fri, 21 Sep 2007 00:02:12 +0000 (+0000) Subject: Bulletproof the namespace grabbing X-Git-Tag: v1.003015~156 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fb1f68748abc529c6ebb39708316ad6954d32d7b;p=p5sagit%2FDevel-REPL.git Bulletproof the namespace grabbing git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@3759 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/Devel/REPL/Plugin/Completion.pm b/lib/Devel/REPL/Plugin/Completion.pm index b546488..852e866 100644 --- a/lib/Devel/REPL/Plugin/Completion.pm +++ b/lib/Devel/REPL/Plugin/Completion.pm @@ -54,9 +54,9 @@ around 'eval' => sub { my @ret = $self->$orig($line); # the namespace of the loaded module - if ($line =~ /use\s+(\S+)/) { + if ($line =~ /\buse\s+(\S+)/) { my $module = $1; - foreach my $keyword (keys %{$self->get_namespace($module)}) { + foreach my $keyword (keys %{$self->get_namespace($module) || {}}) { $self->push_completion($keyword); } }