[Chicago-talk] is there a perl which?

Jess Balint jbalint at gmail.com
Wed Feb 8 07:02:41 PST 2006


Here is my shell alias that does it:

perl -MFile::Find -e'sub a{ print $File::Find::name."\n" if(m/pm$/); }
find(\&a, @INC)'

-----Original Message-----
From: chicago-talk-bounces at pm.org [mailto:chicago-talk-bounces at pm.org] On
Behalf Of tiger peng
Sent: Wednesday, February 08, 2006 9:47 AM
To: Chicago.pm chatter
Subject: Re: [Chicago-talk] is there a perl which?

I put an alias in my .profile or .kshrc.
It is from "Perl in a Nutshell". Piping its result to
grep or something else to get what you are looking
for.

alias lspm="find `perl -e 'print "@INC"'` -name '*.pm'
-print"


--- Jay Strauss <me at heyjay.com> wrote:

> On Wednesday 08 February 2006 12:25 am, Andy Lester
> wrote:
> > > Is there a function in Perl analygous to the
> Unix 'which', for
> > > saying where in
> > > the @INC it will find a package?
> >
> > Before it finds it?  Not that I know of.  But
> after it's loaded, yes,
> > you look in %INC.
> >
> 
> I like your way better.  I forgot about %INC.  
> 
> Thanks
> Jay
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
> 

_______________________________________________
Chicago-talk mailing list
Chicago-talk at pm.org
http://mail.pm.org/mailman/listinfo/chicago-talk



More information about the Chicago-talk mailing list