Skip to content

Instantly share code, notes, and snippets.

@mishin
Forked from vifo/cpannti.sh
Created November 15, 2015 12:12
Show Gist options
  • Save mishin/882a3b92224cd41f0409 to your computer and use it in GitHub Desktop.
Save mishin/882a3b92224cd41f0409 to your computer and use it in GitHub Desktop.
Perl: "notest install module" from shell using CPAN
#!/bin/sh
# Usage: cpannti.sh <module_names>
# cpan (i.e. App::Cpan) does not provide a direct way to install modules without
# testing them, as you can do in the CPAN shell with:
#
# cpan[1]> notest install FooBarBaz
#
# App::Cpan uses CPAN::Shell under the hood to perform installation, so let's do
# it ourselves the same way, but pass "notest" this time. Key sub for
# installation is CPAN::Shell::rematein().
perl -MCPAN -e 'foreach (@ARGV) { CPAN::Shell->rematein("notest", "install", $_) }' $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment