add use strict; use warnings to modules, just to be sure
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Plugin / CompletionDriver / LexEnv.pm
index 133baaf..cef75c8 100644 (file)
@@ -1,3 +1,5 @@
+use strict;
+use warnings;
 package Devel::REPL::Plugin::CompletionDriver::LexEnv;
 use Devel::REPL::Plugin;
 use namespace::autoclean;
@@ -16,8 +18,8 @@ around complete => sub {
   return $orig->(@_)
     unless $last->isa('PPI::Token::Symbol');
 
-  my $sigil = substr($last, 0, 1, '');
-  my $re = qr/^\Q$last/;
+  my ($sigil, $name) = split(//, $last, 2);
+  my $re = qr/^\Q$name/;
 
   return $orig->(@_),
          # ReadLine is weirdly inconsistent