Suppose you like Dist::Zilla and cpanminus. Suppose you also need to install the new version of a distribution you're working on locally. (I do this all the time.)
Sure, you can use dzil install
, which builds, tests, and
installs the distribution. That's too slow though—by the time the normal
CPAN shell has loaded its indexes, cpanm
has often finished.
I've already spent more time writing this post than it took to write this silly little shell alias:
alias dzinstall='dzil build; cpanm install *.tar.gz; dzil clean'
Sure, you have to manage your distro with dzil and you have to have
cpanm
configured to use the correct Perl and you can't have any
other tarballs in your directory, but this works really well for me.
Why not just use the built in dzil install?
"dzil install" does have an "--install-command" option, which allows you to specify an alternative command to use for installation - "dzil install --install-command 'cpanm .'" would be pretty much equivalent to your alias.
dzil will probably switch to defaulting to cpanm once I provide a useful mechanism for stating your cpan client pref more globally in the future
i.e., "someday beyond tomorrow"
I will now! I'd never thought to read the documentation for Dist::Zilla::App::Command::install.