Bubblegum is a modern Perl development framework, it enforces common best practices and is intended to be used to enhance your Perl environment and development experience. The design goal of Bubblegum is to be as minimal as possible, enabling as many core features as is justifiable, making the common most repetitive programming tasks simply a method call away, and having all this available by simply requiring this library. This framework is very opinionated and designed around convention over configuration. Designed for adoption, all of the techniques used in this framework are well-known by experienced Perl developers and made conveniently available to programmers at all levels, i.e., no experimental features used. Note: This is an early release available for testing and feedback and as such is subject to change.

use Bubblegum;
# or Bubblegum::Class;
# or Bubblegum::Role
# or Bubblegum::Singleton;

is equivalent to

use 5.10.0;
use strict;
use autobox;
use autodie ':all';
use feature ':5.10';
use warnings FATAL => 'all';
use English -no_match_vars;
use utf8::all;
use mro 'c3';

with the exception that Bubblegum implements it's own autoboxing architecture. The Bubblegum autobox classes are the foundation for this development framework. The decision to re-implement many core and autobox functions was based on the desire to build-in data validation and design a system using roles for a higher level of abstraction. The following functionality is made available simply by using Bubblegum:

Bubblegum makes essential core features and common functionality readily available via automation (autoloading, autoboxing, autodying, etc). It promotes modern Perl best practices by automatically enabling a standard configuration (utf8::all, strict, warnings, features, etc) and by extending core functionality with Bubblegum::Wrapper extensions. Bubblegum is an opinionated object-oriented development framework, the core is designed to leverage as much of the Perl core, 5.10+, as possible and uses Moo to provide a minimalistic object system (compatible with Moose). This framework is modeled using object-roles for a higher-level of abstraction and consistency.

The TIMTOWTDI (there is more than one way to do it) motto has been a gift and a curse. The Perl language (and community) has been centered around this concept for quite some time, in that the language "doesn't try to tell the programmer how to program" which makes it easy to write concise and powerful statements but which also makes it easy to write extremely messy and incoherent software (with great power comes great responsibility). Another downside is that as the number of decisions a programmer has to make increases, their productivity decreases. Enforced consistency is a path many other programming languages and frameworks have adopted to great effect, so Bubblegum is one approach towards that end in Perl.

Additional features and enhancements can be enabled by using the Bubblegum::Constraints module which exports type constraint and validation functions, and the Bubblegum::Functions module which exports various utility functions. Bubblegum is designed as a construction-kit; having it's feature-set compartmentalized in such a way as to allow the maximum amount of interoperability. Bubblegum can be used along-side any of the many object-systems. Hardcore Perl hackers around the world are working tirelessly around the clock to give us a better system for elegantly defining objects and classes using modern Perl best practices, ... but in the meantime, have some Bubblegum.

use Bubblegum;
use Bubblegum::Functions 'will';
# take a moment to reason about the following Perl example.
my $print = will '@output; say @output';
$print->curry(1..10)->call; # 12345678910

Bubblegum type classes are built as extensions to the autobox type classes. The following is the custom autobox type, subtype and roles hierarchy. All native data types inherit their functionality from the universal class, then whichever autobox subtype class is appropriate and so on. Bubblegum overlays object-roles on top of this design to enforce constraints and consistency. The following is the current layout of the object roles and relationships. Note, this will likely evolve.

A Bubblegum::Wrapper module exists to extend Bubblegum itself and further extend the functionality of native data types by letting the data bless itself into wrappers (plugins) in a chain-able discoverable manner. It's also useful as a technique for coercion and indirect object instantiation. The following is an example:

Undef operations work on variables whose value is undefined. Note, undef operations do not work on undef directly. Please see Bubblegum::Object::Undef for more information on operations associated with undefined variables.