#!/usr/bin/perl -w use strict; foreach (sort { lc($a) cmp lc($b) } map { `cd $_ && find . -name '*.pm +'` } @INC) { s/^\.\/(.*)\.pm$/$1/; s/\//::/g; print; }
I grant the above code isn't particularly obfuscated, but I was attempting to produce a minimalist one-liner. It ended up taking me the better half of a day, but I learned quite a bit about perl while trying to reduce my code.
Can someone make it even shorter still (preferably with an accompanying explanation if obfuscation warrants) so that I may learn from the code of my fellow monks of this hallowed monastery.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorted List of Available Modules
by Jaap (Curate) on Apr 17, 2005 at 17:42 UTC |