Prancer::Core
use Prancer::Core qw(config); my $core = Prancer::Core->new('/path/to/config.yml'); my $foo = $core->config->get('foo'); my $bar = Prancer::Core->new->config->get('bar'); my $baz = config->get('baz');
This class is a singleton that contains some core methods for Prancer to more easily function. This package can be initialized and used on its own if you want to use Prancer outside of a PSGI application.
Since this package is a singleton, it might happen that you have a place in your code where you try to use a method from this package before you are able to initialize it with the necessary arguments to new. This will tell you if this package has been initialized.
new
die "core has not been initialized" unless Prancer::Core->initialized(); print Prancer::Core->new->config->get('foo');
Returns the configuration options parsed when this package was initialized. See Prancer::Config for more details on how to load and use the configuration data.
To install Prancer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prancer
CPAN shell
perl -MCPAN -e shell install Prancer
For more information on module installation, please visit the detailed CPAN module installation guide.