So my question is this: Say I have a directory of 200 modules, all in tgz packages, and I want to install them into my freshly built new Perl version.
[off the top of my head, untested] Inside the directory of TGZ modules -
#! /usr/local/bin/perl -w
eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
if 0; #$running_under_some_shelluse strict; use warnings;
# Hmmm....
# die "cannot un-gtar files"
# if ((system("gtar zxvf *.t*z") / 256));use File::Find ();
use vars qw/*name *dir *prune @targets/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune;
sub wanted;
File::Find::find({wanted => \&wanted}, '.');
sub wanted {
my ($dev,$ino,$mode,$nlink,$uid,$gid);push @targets, (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
-f _ &&
/^Makefile\.PL\z/s &&
sprintf("%s",$name);
}# Do something with targets -
print @ argets;
# foreach, while, season to taste...__END__
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
