CONSTANTS
Set to "Badger::Constants".
SCALAR
The literal word "SCALAR", typically used for testing references.
if (ref $data eq SCALAR) {
...
}
ARRAY
The literal word "ARRAY", typically used for testing references.
if (ref $data eq ARRAY) {
...
}
HASH
The literal word "HASH", typically used for testing references.
if (ref $data eq HASH) {
...
}
CODE
The literal word "CODE", typically used for testing references.
if (ref $data eq CODE) {
...
}
GLOB
The literal word "GLOB", typically used for testing references.
if (ref $data eq GLOB) {
...
}
REGEX
The literal word "Regexp", typically used for testing references.
if (ref $data eq REGEX) {
...
}
FALSE
A false value (0)
TRUE
A true value (1)
OFF
A generic flag used to disable things (0).
ON
A generic flag used to enable things (1).
ALL
The literal string "all".
NONE
The literal string "none".
DEFAULT
The literal string "default".
WARN
The literal string "warn".
LAST
The value "-1", used to index the last item in an array.
$array[LAST];
CRLF
An unambiguous carriage return and newline sequence: "\015\012"
PKG
An alias for the "::" symbol used to delimiter Perl packages. Typically used to construct symbol
references.
use Badger::Constants 'PKG';
use constant EXAMPLE => 'EXAMPLE';
my $var = ${ $pkg.PKG.EXAMPLE }; # same as: ${"${pkg}::EXAMPLE"}
DOT
An alias for a dot ".".
REFS
The literal string "refs". Typically used like so:
no strict REFS;
ONCE
The literal string "once". Typically used like so:
no warnings ONCE;
BLANK
An empty string. How much more blank could this be? And the answer is none. None more blank.
SPACE
A single space character. Not to be confused with the three dimensional fabric of reality that it happens
to share a name with.
SLASH
A forward slash as used to separate path segments in URIs and filesystem paths on sane operating systems.
DELIMITER
A regular expression used to split whitespace delimited tokens. Also accepts commas with optional
trailing whitespace as a delimiter.
$names = [ split DELIMITER, $names ]
unless ref $names eq ARRAY;
WILDCARD
A regular expression used to match strings containing the "*" or "?" wildcard characters.
if ($path =~ WILDCARD) {
# do something...
}
UTF8
The literal string "utf8".
JSON
The literal string "json".
YAML
The literal string "yaml".
LOADED
Contains the literal string "BADGER_LOADED". The Badger::Class module uses it to define the
$BADGER_LOADED variable in any modules that it loads.