X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FCommands.pm;h=689e656d3bbc5c85eda321e1bba39ccf0a95011b;hp=04aa22e8d499cedf9b5ea6ede3170ef2a7c02528;hb=moo;hpb=9b7bfb6ac233dca407f12db47aa8dda7c9c1d338 diff --git a/lib/Devel/REPL/Plugin/Commands.pm b/lib/Devel/REPL/Plugin/Commands.pm index 04aa22e..689e656 100644 --- a/lib/Devel/REPL/Plugin/Commands.pm +++ b/lib/Devel/REPL/Plugin/Commands.pm @@ -3,7 +3,7 @@ package Devel::REPL::Plugin::Commands; use Devel::REPL::Plugin; use Scalar::Util qw(weaken); -use namespace::autoclean; +use namespace::sweep; use vars qw($COMMAND_INSTALLER); has 'command_set' => ( @@ -15,7 +15,9 @@ sub BEFORE_PLUGIN { my ($self) = @_; $self->load_plugin('Packages'); unless ($self->can('setup_commands')) { - $self->meta->add_method('setup_commands' => sub {}); + my $pkg = ref $self || $self; + no strict 'refs'; + *{"${pkg}::setup_commands"} = sub { }; } }