#!/usr/bin/perl $| = 1; use strict; use warnings; #use CGI::Carp qw( fatalsToBrowser ); sub GetModules { my $dp = shift; my ( $dh, $dn ); my @m; opendir( $dh, $dp ); while ( $dn = readdir($dh) ) { next if $dn =~ /^\.\.?$/; # falls ., oder .. my $p = "$dp/$dn"; push @m, GetModules($p) if ( -d $p ); push @m, $p if ( -f $p ) && ( $p =~ /\.(pm|cgi|pl)$/i ); } closedir($dh); return @m; } my @moddirs = @INC; my $ismodule; print "Content-Type: text/plain\n\n" if $ENV{'REMOTE_ADDR'}; # Falls auf Server foreach my $d (@moddirs) { $d =~ s#\\#/#g if $d =~ /\\/; foreach my $m ( GetModules($d) ) { if ( $ismodule = ( $m =~ /\.pm$/i ) ) { $m =~ s/\.pm$//i; $m =~ s/^$d//; $m =~ s/\//::/g; $m =~ s/^:://; $m =~ s/::$//; } print "$m "; if ($ismodule) { eval "require $m; print \$" . $m . '::VERSION;'; #eval "require $m; print \&" . $m . '::Version();' if $@; } print "\n"; } } 1; =pod Zeigt alle Module im @INC an =cut