#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; print STDERR "Scanning ...\n"; # find dependent things ... note 'scandeps' only considers modules. # note: do not say "*.pm" here or you won't look in subdirs # replace 'path_to_my_app_libs' with whatever is correct for you ... my @output = qx{scandeps.pl /path_to_my_app_libs/*}; my @keepers; # The output of interest is the module-name, found in single quotes foreach (@output) { chomp; next unless /^'([A-Z].*?)'/; push @keepers, $1; } print STDERR "Installing ...\n"; foreach (@keepers) { # The output is a little "wordy." # Omit hundreds o' things that we know are really parts of others. next if /^Date::Manip::TZ::/; next if /^Date::Manip::Offset::/; qx{cpanm $_}; # install it } # see if we got everything ... # (failure of some of these is not necessarily awful) foreach (@keepers) { print STDERR "require $_\n"; eval "require $_"; # magic necessary voodoo ... see 'perldoc require' } print "Normal completion.\n";