Quick Tip #30: Uninstall a Perl 6 module

You can uninstall Perl 6 modules. Many people have asked for a way to uninstall a Perl 5 module, but that toolchain didn’t do the sort of tracking that Perl 6 does. Some of these are recent developments, so you should have the most recent Rakudo that you can use.

In zef:

$ zef uninstall Some::Module

You might like Slightly less basic Perl6 module management, as well as the rest of Nick’s blog.

If that doesn’t work, niner has a gist that reaches into the internals:

#!/usr/bin/env perl6
use v6.c;

sub MAIN($short-name, :$ver = True, :$auth = True, :$api = True) {
    my $comp-unit = $*REPO.resolve(CompUnit::DependencySpecification.new(:$short-name, :$ver, :$auth, :$api));
    $comp-unit.repo.uninstall($comp-unit.distribution);
}

This is the final Quick Tip. Thanks to everyone who helped me reach my Kickstarter goal. Now I have to get down to fulfilling your rewards and writing the book!

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *