Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: perl modules

by oko1 (Deacon)
on Mar 05, 2009 at 23:13 UTC ( [id://748701]=note: print w/replies, xml ) Need Help??


in reply to perl modules

Here's a solution that I cribbed from Randal Schwartz years ago and modified to my own tastes:

#!/usr/bin/perl -w use strict; use File::Find; my $re = shift || "."; find sub { return unless my ($x) = $File::Find::name =~ m{\./(.*\.pm)$}; $x =~ s,/,::,g; print "$x\n" if /\Q$re\E/i; }, map "$_/.", grep -d && /^[^.]/, @INC;

If you just invoke it by name, you get the entire list of installed modules. If you specify a regex as an argument, you'll get only the modules that match the regex (case-insensitive). I use it pretty regularly.


--
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-04-18 06:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found