<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Module::Build::Config;

use strict;
use vars qw($VERSION);
$VERSION = '0.4205';
$VERSION = eval $VERSION;
use Config;

sub new {
  my ($pack, %args) = @_;
  return bless {
		stack =&gt; {},
		values =&gt; $args{values} || {},
	       }, $pack;
}

sub get {
  my ($self, $key) = @_;
  return $self-&gt;{values}{$key} if ref($self) &amp;&amp; exists $self-&gt;{values}{$key};
  return $Config{$key};
}

sub set {
  my ($self, $key, $val) = @_;
  $self-&gt;{values}{$key} = $val;
}

sub push {
  my ($self, $key, $val) = @_;
  push @{$self-&gt;{stack}{$key}}, $self-&gt;{values}{$key}
    if exists $self-&gt;{values}{$key};
  $self-&gt;{values}{$key} = $val;
}

sub pop {
  my ($self, $key) = @_;

  my $val = delete $self-&gt;{values}{$key};
  if ( exists $self-&gt;{stack}{$key} ) {
    $self-&gt;{values}{$key} = pop @{$self-&gt;{stack}{$key}};
    delete $self-&gt;{stack}{$key} unless @{$self-&gt;{stack}{$key}};
  }

  return $val;
}

sub values_set {
  my $self = shift;
  return undef unless ref($self);
  return $self-&gt;{values};
}

sub all_config {
  my $self = shift;
  my $v = ref($self) ? $self-&gt;{values} : {};
  return {%Config, %$v};
}

1;
</pre></body></html>