Class:...::Perl(3pm)
π Class::Meta::Types::Perl β Perl data types π
okay bestie, so this is one of those User Contributed Perl Documentation pages, and honestly? it's a little gem. it's Class:...::Perl(3pm) in the wild, but we're gonna call it by its government name: Class::Meta::Types::Perl. it's giving "small module, big main character energy." π«Ά
β¨ NAME β¨
Class::Meta::Types::Perl β Perl data types. that's it. that's the whole name. short, sweet, iconic. π
π SYNOPSIS π
here's the vibe, copy-paste ready, no notes:
package MyApp::Thingy;
use strict;
use Class::Meta;
use Class::Meta::Types::Perl;
# OR...
# use Class::Meta::Types::Perl 'affordance';
# OR...
# use Class::Meta::Types::Perl 'semi-affordance';
BEGIN {
# Create a Class::Meta object for this class.
my $cm = Class::Meta->new( key => 'thingy' );
# Add an integer attribute.
$cm->add_attribute( name => 'my_hash',
type => 'hash' );
$cm->build;
}
notice the comments? those three use lines are alternatives β you can load it plain, or with 'affordance', or with 'semi-affordance'. pick your fighter. π₯
πΈ DESCRIPTION πΈ
so like, this module hands you Perl data types so you can use them with Class::Meta attributes. the way that you use it is so easy: just load it, then pass the name of one of its types to the add_attribute() method on a Class::Meta object. that's the whole ritual. β¨
want the deep lore on using and creating data types? that's in Class::Meta::Type. go read it, bestie, it's right there. π
the validation checks for Class::Meta::Types::Perl come from Class::Meta::Type's support for object type validation β because Perl data types are understood by UNIVERSAL::isa(). no cap. π§
here are the data types this module creates, one by one, no skipping:
scalarβ a simple scalar value. it can be anything, and it has no validation checks. zero rules, zero problems, truly living its best life. πscalarrefβ a scalar reference.UNIVERSAL::isa()must return'SCALAR'.arrayarrayrefβ a array reference.UNIVERSAL::isa()must return'ARRAY'. (yes, both names, same energy. twins. π―)hashhashrefβ a hash reference.UNIVERSAL::isa()must return'HASH'.codecoderefclosureβ a code reference. also known as a closure.UNIVERSAL::isa()must return'CODE'. three names for one slay. π
π¦ SUPPORT π¦
this module lives in an open GitHub repository at <http://github.com/theory/class-meta/>. feel free to fork and contribute β literally, the door is open, come through. π
got a bug? file it via GitHub Issues at <http://github.com/theory/class-meta/issues/> or send mail to <bug-Class-Meta@rt.cpan.org> (mailto: <bug-Class-Meta@rt.cpan.org>). we listen, we care, we fix. π«Ά
π AUTHOR π
David E. Wheeler <david@justatheory.com>. the icon, the legend, the moment. π
π SEE ALSO π
other classes of interest within the Class::Meta distribution, aka the friend group:
Class::Metaβ this class contains most of the documentation you need to get started withClass::Meta. start here, bestie, fr fr.Class::Meta::Typeβ this class manages the creation of data types.Class::Meta::Attributeβ this class managesClass::Metaclass attributes, all of which are based on data types.
other data type modules, the extended universe:
Class::Meta::Types::StringClass::Meta::Types::BooleanClass::Meta::Types::Numeric
π COPYRIGHT AND LICENSE π
Copyright (c) 2002-2011, David E. Wheeler. Some Rights Reserved.
this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
periodt. no cap, that's the actual license text, don't @ me. π
and that's the whole page, bestie! π this was perl v5.34.0, dated 2022-06-11, filed under Class:...::Perl(3pm). go forth and type your data responsibly. slay. β¨π¦πΈ
π¦ where this page comes from
- debian bookworm: libclass-meta-perl 0.66-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libclass-meta-perl 0.66-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libclass-meta-perl 0.66-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms