Bubblegum::Singleton - Singleton Pattern for Bubblegum via Moo
package Configuration; use Bubblegum::Singleton; has hostname => ( is => 'rw', default => 'localhost' );
my $config = Configuration->new; $config->hostname('example.com'); $config = Configuration->new; say $config->hostname; # example.com $config = $config->renew; say $config->hostname; # localhost
Bubblegum::Singleton provides a simple singleton object for your convenience by way of Moo and activates all of the options enabled by the Bubblegum module. Using this module allows you to define classes as if you were using Moo directly. Note: This is an early release available for testing and feedback and as such is subject to change.
is equivalent to
use 5.10.0; use strict; use warnings; use autobox; use autodie ':all'; use feature ':5.10'; use English -no_match_vars; use utf8::all; use mro 'c3'; use Moo;
Al Newkirk <email@example.com>
This software is copyright (c) 2013 by Al Newkirk.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.