X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FPackages.pm;h=77fdebdc5e5d05180ce8af1d27edfd9f5a60bdca;hb=e41f170c93f4a3abb291e3513e1032813b1dfa04;hp=14c0f60e000650a36084466348c86d242e62e0ec;hpb=cfd1094b45c394258ccda08216f1435bf40e1d50;p=p5sagit%2FDevel-REPL.git diff --git a/lib/Devel/REPL/Plugin/Packages.pm b/lib/Devel/REPL/Plugin/Packages.pm index 14c0f60..77fdebd 100644 --- a/lib/Devel/REPL/Plugin/Packages.pm +++ b/lib/Devel/REPL/Plugin/Packages.pm @@ -1,9 +1,11 @@ +use strict; +use warnings; package Devel::REPL::Plugin::Packages; use Devel::REPL::Plugin; -use namespace::clean -except => [ "meta" ]; +use namespace::autoclean; -use vars qw($PKG_SAVE); +our $PKG_SAVE; has 'current_package' => ( isa => 'Str', @@ -26,7 +28,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; };