Myriad::Class - common pragmata for Myriad core modules
package Example::Class; use Myriad::Class; async method startup { $log->infof('Starting %s', __PACKAGE__); } 1;
Since Myriad is a framework, by default it attempts to enforce a common standard on all microservice modules. This same standard is used in most of the modules which comprise Myriad itself.
The following Perl language features and modules are applied:
strict
warnings
utf8
"signatures" in perlsub
no indirect
no multidimensional
no bareword::filehandles
Syntax::Keyword::Try
Syntax::Keyword::Dynamically
Syntax::Keyword::Defer
Future::AsyncAwait
provides "blessed" in Scalar::Util, "weaken" in Scalar::Util, "refaddr" in Scalar::Util
provides "min" in List::Util, "max" in List::Util, "sum0" in List::Util
provides "any" in List::Keywords, "all" in List::Keywords
provides "encode_json_text" in JSON::MaybeUTF8, "encode_json_utf8" in JSON::MaybeUTF8, "decode_json_text" in JSON::MaybeUTF8, "decode_json_utf8" in JSON::MaybeUTF8, "format_json_text" in JSON::MaybeUTF8
In addition, the following core features are enabled:
bitwise
current_sub
evalbytes
fc
postderef_qq
state
unicode_eval
unicode_strings
The calling package will be marked as an Object::Pad class, providing the "method" in Object::Pad, "has" in Object::Pad and async method keywords.
async method
This also makes available a Log::Any instance in the $log package variable, and for OpenTracing::Any support you get $tracer as an OpenTracing::Tracer instance.
$log
$tracer
It's very likely that future versions will bring in new functionality or enable/disable a different featureset. This behaviour will be controlled through version tags:
use Myriad::Class qw(:v1);
with the default being :v1.
:v1
Deriv Group Services Ltd. DERIV@cpan.org.
DERIV@cpan.org
See "CONTRIBUTORS" in Myriad for full details.
Copyright Deriv Group Services Ltd 2020-2021. Licensed under the same terms as Perl itself.
To install Myriad, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Myriad
CPAN shell
perl -MCPAN -e shell install Myriad
For more information on module installation, please visit the detailed CPAN module installation guide.