#!/app/gmd/sw/perl5.12.3.linux/bin/perl use strict; use CPAN::Distroprefs; my %ext_map = ( 'yml' => 'Proc::ProcessTable', 'dd' => 'Proc::ProcessTable', ); my $prefs_dir = '/cs/gmd/sw/perl5.12.3.linux'; my $finder = CPAN::Distroprefs->find($prefs_dir, \%ext_map); while (my $result = $finder->next) { die $result->as_string if $result->is_fatal; warn($result->as_string), next if $result->is_warning; for my $pref (@{ $result->prefs }) { if ($pref->matches(\%ext_map)) { return $pref; } } } print "Hello world\n";