Current Path : /usr/local/lib/perl5/site_perl/5.8.9/Module/Build/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/local/lib/perl5/site_perl/5.8.9/Module/Build/Config.pm |
package Module::Build::Config; use strict; use vars qw($VERSION); $VERSION = '0.30'; $VERSION = eval $VERSION; use Config; sub new { my ($pack, %args) = @_; return bless { stack => {}, values => $args{values} || {}, }, $pack; } sub get { my ($self, $key) = @_; return $self->{values}{$key} if ref($self) && exists $self->{values}{$key}; return $Config{$key}; } sub set { my ($self, $key, $val) = @_; $self->{values}{$key} = $val; } sub push { my ($self, $key, $val) = @_; push @{$self->{stack}{$key}}, $self->{values}{$key} if exists $self->{values}{$key}; $self->{values}{$key} = $val; } sub pop { my ($self, $key) = @_; my $val = delete $self->{values}{$key}; if ( exists $self->{stack}{$key} ) { $self->{values}{$key} = pop @{$self->{stack}{$key}}; delete $self->{stack}{$key} unless @{$self->{stack}{$key}}; } return $val; } sub values_set { my $self = shift; return undef unless ref($self); return $self->{values}; } sub all_config { my $self = shift; my $v = ref($self) ? $self->{values} : {}; return {%Config, %$v}; } 1;