Handel::ConfigReader

Handel::ConfigReader can read in Handel configuration settings from ENV/ModPerl.
Download

Handel::ConfigReader Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Christopher H. Laco
  • Publisher web site:
  • http://search.cpan.org/~claco/Handel-1.00009/lib/Handel/Manual/QuickStart.pod

Handel::ConfigReader Tags


Handel::ConfigReader Description

Handel::ConfigReader can read in Handel configuration settings from ENV/ModPerl. Handel::ConfigReader can read in Handel configuration settings from ENV/ModPerl.SYNOPSIS use Handel::ConfigReader; my $cfg = Handel::ConfigReader->instance(); my $setting = $cfg->get('HandelMaxQuantity'); my $other = $cfg->{'OtherSetting'};Handel::ConfigReader is a generic wrapper to get various configuration values. As some point this will probably get worked into XS/custom httpd.conf directives.Each configuration object is also a tied hash. The two usages are the same: my $cfg = Handel::ConfigReader->instance(); my $setting = $cfg->get('Setting'); my $setting = $cfg->{'Setting'};The latter is the preferred usage in anticipation of also integrating Apache::ModuleConfig and custom directives which use the same hash syntax.CONSTRUCTORnewReturns a new Handel::ConfigReader instance. my $cfg = Handel::ConfigReader->new();instanceReturns the same Handel::ConfigReader instance for each call. my $cfg = Handel::ConfigReader->instance();METHODSgetArguments: $key Returns the configured value for the key specified. You can use this as an instance method or as a simpleton: my $cfg = Handel::ConfigReader->instance(); my $setting = $cfg->get('HandelMaxQuantity'); my $cfg = Handel::ConfigReader->instance(); my $setting = $cfg->get('HandelMaxQuantity');You can also pass a default value as the second parameter. If no value is loaded for the key specified, the default value will be returned instead. my $cfg = Handel::ConfigReader->instance(); my $setting = $cfg->get('DoesNotExist', 'foo'); print $setting; # fooFETCHArguments: $keyReturns an item form the configuration via tied hash. my $cfg = Handel::ConfigReader->new; my $setting = $cfg->{'MySetting'};EXISTSArguments: $keyReturns true if the specified setting returns a defined value. my $cfg = Handel::ConfigReader->new; if (exists $cfg->{'MySetting'}) { ... }; Requirements: · Perl


Handel::ConfigReader Related Software