#!/usr/bin/perl -w use strict; use warnings; chomp( @_ = `perldoc -T perllocal` ); # List EXE_FILES installed by CPAN $_ = join "\n", @_; @_ = split /\"Module\"\s/; @_ = grep /EXE_FILES:\s[^"]+/, @_; for (@_) { @x = split /\n/; @x = grep /EXE|0m/, @x; push @z, @x; } s/^\s+\*\s+\"([^\"]+).?/$1/ for @z; @_ = grep /EXE_FILES/, @z; @_ = map { substr( $_, 11, length($_) ) } @_; undef @z; for (@_) { if (/\s/) { @x = split /\s/; push @z, $_ for @x } else { push @z, $_ } } %_ = map { s/^\S+\///; $_ => 1 } @z; print $_ for sort { lc($a) cmp lc($b) } keys %_;