Thread ExtUtils::Installed findet nicht alle Module? (37 answers)
Opened by bianca at 2012-10-24 11:39

GwenDragon
 2012-10-24 13:53
#162797 #162797
User since
2005-01-17
14748 Artikel
Admin1
[Homepage]
user image
Schnellschuss:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!perl

use File::Find;

sub scan {
    my @found;
    for my $dir (@_) {
        my $topdir = $dir;
        find(
            sub {
                if ( -f $File::Find::name
                    && $File::Find::name =~ /\.pm$/ )
                {
                    my $fn = $File::Find::name;
                    $fn =~ s/\Q$topdir//g;
                    $fn =~ s/\//::/g;
                    $fn =~ s/^:://g;
                    $fn =~ s/\.pm//g;
                    push @found, $fn;
                }
            },
            $dir
        );
    }
    return @found;
}

print join "\n", scan(@INC);


//EDIT:
Dass use strict & Co. fehlt, der Shebang so seltsam ist, das kannst du ja anpassen auf Grund deines Wissens.
Last edited: 2012-10-24 14:04:59 +0200 (CEST)

View full thread ExtUtils::Installed findet nicht alle Module?