Just as another answer my personal pmver shell function. Exits with error if any of the named modules aren't available.
pmver () { perl -le '$exit=0;for $f (@ARGV) { eval qq{require $f}; if( $@ + =~ /locate (\S+)\.pm/ ) { print qq{$f not installed}; $exit=1;next} +print qq{$f: },${"${f}::VERSION"}||q{undefined}}exit $exit' "$@" }
Edit: Apt point below. Historically I've used this checking if/what CPAN stuff's installed so that was my expected failure mode WRT require. A more bullet proof version would probably report $@ in any failure (and/or use Try::Tiny).
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Indirect variable expansion
by Fletch
in thread Indirect variable expansion
by mvanle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |