NAME

OP::Constants

DESCRIPTION

Loads .oprc values as Perl constants, with optional export.

.oprc is a YAML file containing constant values used by OP. It should be located under $ENV{OP_HOME}, which defaults to /opt/op.

SYNOPSIS

To import constants directly, just specify them when using OP::Constants:

use OP::Constants qw| dbUser dbPass |;

my $dbUser = dbUser;
my $dbPass = dbPass;

To access the constants without importing them into the caller's namespace, just fully qualify them:

use OP::Constants;

my $dbUser = OP::Constants::dbUser;
my $dbPass = OP::Constants::dbPass;

EXAMPLE

The following is an example of an .oprc file. The file contents must be valid YAML.

---
dbHost: localhost
dbPass: ~
dbPort: 3306
dbUser: op
memcachedHosts:
  - 127.0.0.1:31337
sqliteRoot: /opt/op/sqlite
yamlRoot: /opt/op/yaml
scratchRoot: /tmp
apiUser: root

REVISION

$Id: //depotit/tools/snitchd/OP-0.20/lib/OP/Constants.pm#1 $

SEE ALSO

YAML::Syck, constant

This file is part of OP.