GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Class::Data::Lite(3) User Contributed Perl Documentation Class::Data::Lite(3)

Class::Data::Lite - a minimalistic class accessors

    package MyPackage;
    use Class::Data::Lite (
        rw => {
            readwrite => 'rw',
        },
        ro => {
            readonly => 'ro',
        },
    );
    package main;
    print(MyPackage->readwrite); #=> rw

Class::Data::Lite is a minimalistic implement for class accessors. There is no inheritance and fast.

The use statement (i.e. the "import" function) of the module takes a single hash as an argument that specifies the types and the names of the properties. Recognises the following keys.

"rw" => (\@name_of_the_properties|\%name_of_the_properties_and_values)
creates a read / write class accessor for the name of the properties passed through as an arrayref or hashref.
"ro" => (\@name_of_the_properties|\%name_of_the_properties_and_values)
creates a read-only class accessor for the name of the properties passed through as an arrayref or hashref.

It is faster than Class::Data::Inheritance. See "eg/bench.pl".

                                  Rate Class::Data::Inheritable    Class::Data::Lite
    Class::Data::Inheritable 2619253/s                       --                 -38%
    Class::Data::Lite        4191169/s                      60%                   --

Class::Accessor::Lite, Class::Data::Inheritance

Copyright (C) Songmu.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Songmu <y.songmu@gmail.com>

2019-01-28 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.