perl-Class-XSConstructor - a super-fast (but limited) constructor in XS

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports x86_64
Package filename perl-Class-XSConstructor-0.009-alt1.1.x86_64.rpm
Package name perl-Class-XSConstructor
Package version 0.009
Package release alt1.1
Package architecture x86_64
Package type rpm
Category Development/Perl
Homepage -
License -
Maintainer -
Download size 59.16 KB
Installed size 59.16 KB
the Class::XSAccessor manpage is able to provide you with a constructor for your class,
but it's fairly limited. It basically just does:
sub new {
my $class = shift;
bless { @_ }, ref($class)||$class;
Class::XSConstructor goes a little further towards Moose-like constructors,
adding the following features:
=item *
Supports initialization from a hashref as well as a list of key-value pairs.
=item *
Only initializes the attributes you specified. Given the example in the
my $obj = Person->new(name => "Alice", height => "170 cm");
The height will be ignored because it's not a defined attribute for the
=item *
Supports required attributes using an exclamation mark. The name attribute
in the synopsis is required.
=item *
Provides support for type constraints.
use Types::Standard qw(Str Int);
use Class::XSConstructor (
"name!"    => Str,
"age"      => Int,
"email"    => Str,
"phone"    => Str,
Type constraints can also be provided as coderefs returning a boolean:
use Types::Standard qw(Str Int);
use Class::XSConstructor (
"name!"    => Str,
"age"      => Int,
"email"    => sub { !ref($_[0]) and $_[0] =~ /\@/ },
"phone"    => Str,
Type constraints are likely to siginificantly slow down your constructor.
Note that Class::XSConstructor is only building your constructor for you.
For read-write attributes, *checking the type constraint in the accessor
is your responsibility*.
=item *
Supports Moose/Moo/Class::Tiny-style `BUILD' methods.
Including `__no_BUILD__'.


Package Version Architecture Repository
perl-Class-XSConstructor-0.009-alt1.1.i586.rpm 0.009 i586 Autoimports
perl-Class-XSConstructor - - -


Name Value
/usr/lib64/perl5 - - - - -
perl(Exporter/ >= 1.0
perl(List/ >= 1.450
perl(Ref/ >= 0.100
perl( -
rpmlib(PayloadIsLzma) -
rpmlib(SetVersions) -
rtld(GNU_HASH) -


Name Value
perl(Class/ = 0.009
perl-Class-XSConstructor = 0.009-alt1.1


Type URL
Binary Package perl-Class-XSConstructor-0.009-alt1.1.x86_64.rpm
Source Package perl-Class-XSConstructor-0.009-alt1.1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    rpm [Sisyphus] x86_64 autoimports
    rpm [Sisyphus] noarch autoimports
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Class-XSConstructor rpm package:
    # sudo apt-get install perl-Class-XSConstructor



See Also

Package Description
perl-Classic-Perl-0.07-alt1.1.x86_64.rpm Selectively reinstate deleted Perl features
perl-Clone-AsUTF8Bytes-0.34-alt4.1.x86_64.rpm recursively copy Perl data converting to UTF-8 bytes
perl-Clone-Fast-0.97-alt2_15.x86_64.rpm Natively copying Perl data structures
perl-Clownfish-0.6.3-alt1.1.x86_64.rpm Apache Clownfish Runtime
perl-Clownfish-CFC-0.6.3-alt1.1.x86_64.rpm CFC Apache Clownfish compiler
perl-Code-Class-C-0.08-alt4.1.x86_64.rpm Perl extension for creating ANSI C code from a set
perl-Code-DRY-0.10-alt1.x86_64.rpm Cut-and-Paste-Detector for Perl code
perl-Code-DRY-scripts-0.10-alt1.x86_64.rpm Code-DRY scripts
perl-Collision-2D-0.07-alt4.2.x86_64.rpm Continuous 2d collision detection
perl-Colon-Config-0.003-alt1.1.x86_64.rpm XS helper to read a configuration file using ':' as separator
perl-Combine-Keys-0.09-alt2.1.x86_64.rpm keys on multiple hash references!
perl-Comedi-Lib-0.24-alt4.1.x86_64.rpm Perl API for Comedilib
perl-Compress-Huffman-Binary-0.01-alt2.1.x86_64.rpm Binary-only Huffman coding
perl-Compress-LZ4Frame-0.012002-alt1.1.x86_64.rpm Compression package using the lz4frame library
perl-Compress-LZV1-0.04-alt4.1.x86_64.rpm perl module Compress-LZV1