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

Re: Sorted List of Available Modules

by Jaap (Curate)
on Apr 17, 2005 at 17:42 UTC ( [id://448659]=note: print w/replies, xml ) Need Help??


in reply to Sorted List of Available Modules

Here's a cross-platform version that uses the File::Find core module:
use File::Find; my @m; find(sub {if ($File::Find::name =~ m/^\Q$File::Find::topdir\E\/(.+)\.p +m$/i) { $_ = $1; s/\//::/g; push (@m, $_); }}, @INC); $, = "\n"; print sort @m;
It's not very compact but that's mainly because of File::Find's annoying subref way of working. If you don't need the sorting, it can be made quite a bit more compact.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://448659]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found