App-PerlbrewUtils
view release on metacpan or search on metacpan
bin/perlbrew-clean-site-lib view on Meta::CPAN
#!perl
our $DATE = '2016-06-02'; # DATE
our $VERSION = '0.04'; # VERSION
use 5.010001;
use strict;
use warnings;
use App::PerlbrewUtils;
use App::ShellCompleter::perlbrew qw(complete_perl_installed_name);
use Perinci::CmdLine::Any;
our %SPEC;
$SPEC{clean_site_lib} = {
v => 1.1,
summary => 'Clean site lib on a perl',
args => {
perl => {
schema => 'str*',
req => 1,
pos => 0,
completion => sub {
my %args = @_;
complete_perl_installed_name($args{word});
},
},
},
};
sub clean_site_lib {
require File::Path;
my %args = @_;
my $perl = App::PerlbrewUtils::_find_perl_by_name($args{perl})
or return [404, "No such installed perl '$args{perl}'"];
for my $dir (glob "$perl->{dir}/lib/site_perl/*") {
File::Path::remove_tree($dir);
}
[200];
}
Perinci::CmdLine::Any->new(
url => '/main/clean_site_lib',
)->run;
# ABSTRACT: Clean site lib on a perl
# PODNAME: perlbrew-clean-site-lib
__END__
=pod
=encoding UTF-8
=head1 NAME
perlbrew-clean-site-lib - Clean site lib on a perl
=head1 VERSION
This document describes version 0.04 of perlbrew-clean-site-lib (from Perl distribution App-PerlbrewUtils), released on 2016-06-02.
=head1 SYNOPSIS
Usage:
% perlbrew-clean-site-lib [options] <perl>
=head1 DESCRIPTION
Remove all entries under $perl_dir/lib/site_lib/ for a specified perl.
=head1 OPTIONS
C<*> marks required options.
=head2 Configuration options
=over
=item B<--config-path>=I<filename>
Set path to configuration file.
Can be specified multiple times.
=item B<--config-profile>=I<s>
Set configuration profile to use.
=item B<--no-config>
Do not use any configuration file.
( run in 1.774 second using v1.01-cache-2.11-cpan-d8267643d1d )