Bolts::Blueprint::Literal - A blueprint that points to a literal value
version 0.143171
use Bolts; # The usual sugar artifact thing1 => 42; artifact thing2 => ( value => 42 ); artifact thing3 => ( value => [ 'this', 'is', 'an', 'example' ], ); # Or directly... my $meta = Bolts::Bag->start_bag; my $artifact = Bolts::Artifact->new( name => 'thing', blueprint => $meta->locator->acquire('blueprint', 'literal', { value => 42, }, scope => $meta->locator->acquire('scope', '_'), );
Provides a blueprint that points to a single value. This is best used for scalars, strings, and numbers, but could be used for references.
Caveat. In the case of references, the same reference is returned every time so the contents of that reference might be modified by anyone that acquires it. This may be desirable in your application, but there's the warning in case it is not.
Bolts::Blueprint::Role::Injector
This is the literal value to return when this blueprint is resolved. This can be anything you can assign to a scalar variable, including references to arrays and hash (see the caveat above).
Returns the "value".
Always returns true.
This is set. A literal blueprint value acts like a global singleton.
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
This software is copyright (c) 2014 by Qubling Software LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Bolts, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bolts
CPAN shell
perl -MCPAN -e shell install Bolts
For more information on module installation, please visit the detailed CPAN module installation guide.