#!/bin/sh - # pmods - list all installed, nonstandard Perl modules for the given perl # Steve Kinzler, kinzler@cs.indiana.edu, May 02 # adapted from pmods by William H Asquith, Aug 00 # http://www.cs.indiana.edu/~kinzler/home.html#unixadm opts=; bad= while : do case $# in 0) break;; *) case "$1" in -d) opts=-d;; --) shift; break;; -h) bad=t; break;; -*) bad=t; echo "$0: unknown option ($1)" 1>&2;; *) break;; esac shift;; esac done case "$bad,$#" in ,0) perl=perl;; ,1) perl="$1";; *) cat << EOF 1>&2 usage: $0 [ -d ] [ perl ] -d also list the directories for each module EOF exit 1;; esac exec "$perl" -s - $opts <<'EOP' use ExtUtils::Installed; $inst = ExtUtils::Installed->new(); foreach ($inst->modules()) { print "$_ version ", $inst->version($_) || 'NONE', "\n"; map { print " $_\n" } $inst->directories($_) if $d; } EOP