インストール済みモジュールの一覧を取得する のバックアップソース(No.1)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- バックアップ を表示
- インストール済みモジュールの一覧を取得する へ行く。
- 1 (2007-10-29 (月) 16:01:11)
- 2 (2007-10-29 (月) 16:01:37)
**以下のスクリプトを作成して実行する [#p9b78468] # perl modlist.pl -modlist.pl use strict; my %mod_list; listup($_) for grep {$_ ne '.'} @INC; print "$_\n" for sort keys %mod_list; sub listup { my ($base, $path) = @_; (my $mod = $path) =~ s!/!::!g; opendir DIR, "$base/$path" or return; my @node = grep {!/^\.\.?$/} readdir DIR; closedir DIR; foreach (@node) { if (/(.+)\.pm$/) { $mod_list{"$mod$1"} = 1 } elsif (-d "$base/$path$_") { listup($base, "$path$_/") } } }