All pastes #2053647 Raw Edit

Unnamed

public text v1 · immutable
#2053647 ·published 2011-05-03 23:20 UTC
rendered paste body
#!/app/gmd/sw/perl5.12.3.linux/bin/perl

use strict;
use warnings;
use YAML::Syck;
use Data::Dumper;
use CPAN::Distroprefs;

my %ext_map = (
        'yml' => 'YAML::Syck',
        'dd' => 'Data::Dumper',
);

my %info = (
        'distribution' => 'Proc::ProcessTable-0.45',
        );
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(\%info)) {
                        print Data::Dumper::Dumper ( $pref );
                }
        }
}

print "Hello world\n";