grep /^${var}$/ is a little silly, just use $_ eq $var
Sartak [Fri, 21 Sep 2007 05:35:25 +0000 (05:35 +0000)]
git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@3766 bd8105ee-0ff8-0310-8827-fb3f25b6796d

lib/Devel/REPL/Plugin/Completion.pm

index 852e866..ad7c25f 100644 (file)
@@ -67,7 +67,7 @@ around 'eval' => sub {
     foreach my $var (keys %{$lex->get_context('_')}) {
         $var = substr($var, 1); # we drop the variable idiom as it confuses the completion
         $self->push_completion($var) unless 
-            grep /^${var}$/, @{$self->term->Attribs->{completion_word}};
+            grep $_ eq $var, @{$self->term->Attribs->{completion_word}};
     }
 
     return @ret;