grep /^${var}$/ is a little silly, just use $_ eq $var
[p5sagit/Devel-REPL.git] / 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;