From: Frank Brehm Date: Tue, 18 Sep 2007 07:37:34 +0000 (+0000) Subject: Neu dazu X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=71cab948f72e608aa2535640f27a028c5c2d353e;p=scripts%2Fsolaris.git Neu dazu --- diff --git a/get-perl-modules.pl b/get-perl-modules.pl new file mode 100755 index 0000000..665c88b --- /dev/null +++ b/get-perl-modules.pl @@ -0,0 +1,59 @@ +#!/usr/local/bin/perl + +# $Id$ +# $URL$ + +use strict; +use warnings; + +use File::Find; +use File::Spec; +use Data::Dumper; +use Config; + +$Data::Dumper::Indent = 1; +$Data::Dumper::Sortkeys = 1; + +$| = 1; + +my $module = {}; + +my $cur_dir; + +my $arch = $Config{'archname'}; +my $version = $Config{'version'}; + +for my $dir ( @INC ) { + + if ( -d $dir ) { + print "\nDurchsuche Verzeichnis '$dir' ...\n"; + $cur_dir = $dir; + find( \&wanted, $dir ); + } +} + +sub wanted { + + my $file_abs = $File::Find::name; + if ( -f $file_abs and $file_abs =~ /\.pm$/ ) { + # print "Untersuche '$file_abs' ...\n"; + + my ( $volume, $file_in_volume, $file_bla ) = File::Spec->splitpath( $file_abs, 1 ); + $file_in_volume =~ s/^$cur_dir\///; + return if $file_in_volume =~ /^$arch\//; + return if $file_in_volume =~ /^$version\//; + my $modname = $file_in_volume; + $modname =~ s/\.pm$//; + $modname =~ s#/#::#g; + # print "Modul '$modname' gefunden in '$cur_dir' ...\n"; + $module->{$modname} = 1; + } + +} + +# print Dumper( $module ); + +for ( sort { lc($a) cmp lc($b) } keys %$module ) { + print " - $_\n"; +} +