All pastes #2053621 Raw Edit

Unnamed

public text v1 · immutable
#2053621 ·published 2011-05-03 21:24 UTC
rendered paste body
#!/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";