perl-Class-XSConstructor-0.009-alt1.1.i586.rpm


Advertisement

Description

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

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports i586
Package filename perl-Class-XSConstructor-0.009-alt1.1.i586.rpm
Package name perl-Class-XSConstructor
Package version 0.009
Package release alt1.1
Package architecture i586
Package type rpm
Category Development/Perl
Homepage -
License -
Maintainer -
Download size 54.40 KB
Installed size 54.40 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:
=over
=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
synposis:
my $obj = Person->new(name => "Alice", height => "170 cm");
The height will be ignored because it's not a defined attribute for the
class.
=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__'.
=back

Alternatives

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

Requires

Name Value
/usr/lib/perl5 -
libc.so.6(GLIBC_2.1.3) -
libc.so.6(GLIBC_2.4) -
libperl-5.28.so -
libpthread.so.0(GLIBC_2.0) -
perl(Exporter/Tiny.pm) >= 1.0
perl(List/Util.pm) >= 1.450
perl(Ref/Util.pm) >= 0.100
perl(XSLoader.pm) -
rpmlib(PayloadIsLzma) -
rpmlib(SetVersions) -
rtld(GNU_HASH) -

Provides

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

Download

Type URL
Mirror ftp.altlinux.org
Binary Package perl-Class-XSConstructor-0.009-alt1.1.i586.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] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus i586 autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/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

Files

Path
/usr/lib/perl5/Class/XSConstructor.pm
/usr/lib/perl5/auto/Class/
/usr/lib/perl5/auto/Class/XSConstructor/XSConstructor.so
/usr/share/doc/perl-Class-XSConstructor-0.009/COPYRIGHT
/usr/share/doc/perl-Class-XSConstructor-0.009/CREDITS
/usr/share/doc/perl-Class-XSConstructor-0.009/Changes
/usr/share/doc/perl-Class-XSConstructor-0.009/LICENSE
/usr/share/doc/perl-Class-XSConstructor-0.009/README
/usr/share/doc/perl-Class-XSConstructor-0.009/examples/benchmarks.pl

See Also

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