[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-unattended/var/se3/unattended/install/linuxaux/opt/perl/lib/5.10.0/Module/Build/ -> Config.pm (source)

   1  package Module::Build::Config;
   2  
   3  use strict;
   4  use vars qw($VERSION);
   5  $VERSION = '0.2808_01';
   6  $VERSION = eval $VERSION;
   7  use Config;
   8  
   9  sub new {
  10    my ($pack, %args) = @_;
  11    return bless {
  12          stack => {},
  13          values => $args{values} || {},
  14             }, $pack;
  15  }
  16  
  17  sub get {
  18    my ($self, $key) = @_;
  19    return $self->{values}{$key} if ref($self) && exists $self->{values}{$key};
  20    return $Config{$key};
  21  }
  22  
  23  sub set {
  24    my ($self, $key, $val) = @_;
  25    $self->{values}{$key} = $val;
  26  }
  27  
  28  sub push {
  29    my ($self, $key, $val) = @_;
  30    push @{$self->{stack}{$key}}, $self->{values}{$key}
  31      if exists $self->{values}{$key};
  32    $self->{values}{$key} = $val;
  33  }
  34  
  35  sub pop {
  36    my ($self, $key) = @_;
  37  
  38    my $val = delete $self->{values}{$key};
  39    if ( exists $self->{stack}{$key} ) {
  40      $self->{values}{$key} = pop @{$self->{stack}{$key}};
  41      delete $self->{stack}{$key} unless @{$self->{stack}{$key}};
  42    }
  43  
  44    return $val;
  45  }
  46  
  47  sub values_set {
  48    my $self = shift;
  49    return undef unless ref($self);
  50    return $self->{values};
  51  }
  52  
  53  sub all_config {
  54    my $self = shift;
  55    my $v = ref($self) ? $self->{values} : {};
  56    return {%Config, %$v};
  57  }
  58  
  59  1;


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1