[Chicago-talk] is there a perl which?

Andy Lester andy at petdance.com
Tue Feb 7 22:25:38 PST 2006


>
> 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.

$ perl -MTest::More -le'while ( ($key,$val)=each %INC ) { print "$key  
-> $val" }'
Carp.pm -> /usr/share/perl/5.8/Carp.pm
warnings/register.pm -> /usr/share/perl/5.8/warnings/register.pm
Exporter/Heavy.pm -> /usr/share/perl/5.8/Exporter/Heavy.pm
Exporter.pm -> /usr/share/perl/5.8/Exporter.pm
vars.pm -> /usr/share/perl/5.8/vars.pm
strict.pm -> /usr/share/perl/5.8/strict.pm
Test/Builder/Module.pm -> /usr/local/share/perl/5.8.7/Test/Builder/ 
Module.pm
Test/Builder.pm -> /usr/local/share/perl/5.8.7/Test/Builder.pm
warnings.pm -> /usr/share/perl/5.8/warnings.pm
Config.pm -> /usr/lib/perl/5.8/Config.pm
Test/More.pm -> /usr/local/share/perl/5.8.7/Test/More.pm



--
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance





More information about the Chicago-talk mailing list