X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FPackages.pm;h=246cb9e15767a2e8f74e62df69369b89a3aae66c;hb=f4d488326a126a0aed84d669652fde700d89a0de;hp=9fb14bad53341d87d17ef5282d9d11bcc153bc17;hpb=7c7c35c1216e297f82f97dcc0e27a28bc97d4e95;p=p5sagit%2FDevel-REPL.git diff --git a/lib/Devel/REPL/Plugin/Packages.pm b/lib/Devel/REPL/Plugin/Packages.pm index 9fb14ba..246cb9e 100644 --- a/lib/Devel/REPL/Plugin/Packages.pm +++ b/lib/Devel/REPL/Plugin/Packages.pm @@ -1,9 +1,14 @@ +use strict; +use warnings; package Devel::REPL::Plugin::Packages; -use Devel::REPL::Plugin; +# ABSTRACT: Keep track of which package the user is in + +our $VERSION = '1.003027'; -use namespace::clean -except => [ "meta" ]; +use Devel::REPL::Plugin; +use namespace::autoclean; -use vars qw($PKG_SAVE); +our $PKG_SAVE; has 'current_package' => ( isa => 'Str', @@ -26,7 +31,8 @@ around 'mangle_line' => sub { my $line = $self->$orig(@args); # add a BEGIN block to set the package around at the end of the sub # without mangling the return value (we save it off into a global) - $line .= '; BEGIN { $Devel::REPL::Plugin::Packages::PKG_SAVE = __PACKAGE__; }'; + $line .= ' +; BEGIN { $Devel::REPL::Plugin::Packages::PKG_SAVE = __PACKAGE__; }'; return $line; };