/usr/share/perl5/ExtUtils/Config.pm is in libextutils-config-perl 0.007-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | package ExtUtils::Config;
{
$ExtUtils::Config::VERSION = '0.007';
}
use strict;
use warnings;
use Config;
use Data::Dumper ();
sub new {
my ($pack, $args) = @_;
return bless {
values => ($args ? { %$args } : {}),
}, $pack;
}
sub clone {
my $self = shift;
return __PACKAGE__->new($self->{values});
}
sub get {
my ($self, $key) = @_;
return exists $self->{values}{$key} ? $self->{values}{$key} : $Config{$key};
}
sub set {
my ($self, $key, $val) = @_;
$self->{values}{$key} = $val;
delete $self->{serialized};
return;
}
sub clear {
my ($self, $key) = @_;
delete $self->{values}{$key};
delete $self->{serialized};
return;
}
sub exists {
my ($self, $key) = @_;
return exists $self->{values}{$key} || exists $Config{$key};
}
sub values_set {
my $self = shift;
return { %{$self->{values}} };
}
sub all_config {
my $self = shift;
return { %Config, %{ $self->{values}} };
}
sub serialize {
my $self = shift;
return $self->{serialized} ||= Data::Dumper->new([$self->values_set])->Terse(1)->Sortkeys(1)->Dump;
}
1;
=pod
=head1 NAME
ExtUtils::Config - A wrapper for perl's configuration
=head1 VERSION
version 0.007
=head1 SYNOPSIS
my $config = ExtUtils::Config->new();
$config->set('installsitelib', "$ENV{HOME}/lib");
=head1 DESCRIPTION
ExtUtils::Config is an abstraction around the %Config hash.
=head1 METHODS
=head2 new(\%config)
Create a new ExtUtils::Config object. The values in C<\%config> are used to initialize the object.
=head2 get($key)
Get the value of C<$key>. If not overridden it will return the value in %Config.
=head2 exists($key)
Tests for the existence of $key.
=head2 set($key, $value)
Set/override the value of C<$key> to C<$value>.
=head2 clear($key)
Reset the value of C<$key> to its original value.
=head2 values_set()
Get a hashref of all overridden values.
=head2 all_config()
Get a hashref of the complete configuration, including overrides.
=head2 clone()
Clone the current configuration object.
=head2 serialize()
This method serializes the object to some kind of string.
=head1 AUTHORS
=over 4
=item *
Ken Williams <kwilliams@cpan.org>
=item *
Leon Timmermans <leont@cpan.org>
=back
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2006 by Ken Williams, Leon Timmermans.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
__END__
# ABSTRACT: A wrapper for perl's configuration
|