EDIT: The original node was buggy so here's a fixed version that seems to show all the executables installed by CPAN! Original node below so I can be embarrassed forever.☺
List EXE_FILES installed by CPAN:
#!/usr/bin/perl -l
use strict;
use warnings;
# List EXE_FILES installed by CPAN
$_ = join '', `perldoc -uT perllocal`;
@_ = (/EXE_FILES:\s([^>]+)/sg);
my @z = ();
for (@_) {
my @x = split /\s+/;
s/^\S+\/// for @x;
push @z, @x;
}
%_ = map { $_ => 1 } @z;
print $_ for sort keys %_;
#print scalar keys %_;
List EXE_FILES installed by CPAN, by module:
#!/usr/bin/perl -l
use strict;
use warnings;
# List EXE_FILES installed by CPAN, by module
$_ = join '', `perldoc -uT perllocal`;
my @m = (/=head2.*?\|([^>]+)/g);
my @e = (/EXE_FILES:\s([^>]*)/sg);
for (my $c = 0; $c < scalar @m; $c++) {
$_{$m[$c]} = $e[$c]
}
my @z = ();
my $n = 0;
for (sort { lc($a) cmp lc($b) } keys %_) {
if (my @x = split /\s+/, $_{$_}) {
print;
$n += scalar @x;
s/^\S+\/// for @x;
print " $_" for @x;
print "";
}
}
#print $n;
THE ORIGINAL NODE, DOES NOT WORK!:
List EXE_FILES installed by CPAN:
perl -le'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%_'
List EXE_FILES installed by CPAN, by module:
perl -le'chomp(@_=`perldoc -T perllocal`);
# List EXE_FILES installed by CPAN, by module
$_=join"\n",@_; @_=split/\"Module\"\s/,$_;
@_=grep/EXE_FILES:\s[^"]+/,@_;for(@_){@x=split/\n/;
@x=grep/EXE_FILES|0m/,@x;push@z,@x}undef@x;
s/^\s+\*\s+\"([^\"]+).?/$1/ for@z;my$m;for(@z){
if(/EXE_FILES:\s(.*)/){$_{$m}=$1}else{$m=$_;$_{$m}=1}}
for(sort{lc($a)cmp lc($b)}keys %_){if($_{$_}=~/\s/){
@x=split/\s/,$_{$_};s/^\S+\/// for@x;$_{$_}=join"\n ",
@x}else{$_{$_}=~s/^\S+\///g}print"$_\n $_{$_}\n"}'
STOP REINVENTING WHEELS, START BUILDING SPACE ROCKETS!—CPAN 🐪
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.