Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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 🐪

In reply to List EXE_FILES installed by CPAN by usemodperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-23 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found