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


Manual Reference Pages  -  DATA::PERL (3)

.ds Aq ’

NAME

Data::Perl - Base classes wrapping fundamental Perl data types.

CONTENTS

VERSION

version 0.002009

SYNOPSIS



  use Data::Perl;

  my $array = array(1,2,3, qw/a b c/);

  $array->count; # 6

  my @elements = $array->grep(sub {/b/}); # (b)

  my $hash = hash(a => 1, b => 2);

  $hash->keys; # (a, b);

  my $number = number(5);

  $number->add(10); # 15

  my $string = string("foo\n");

  $string->chomp; # return 1, chomps string

  my $counter = counter();

  $counter->inc; # counter is now 1

  my $sub = code(sub { foo });

  $sub->execute; # returns foo

  $foo



DESCRIPTION

Data::Perl is a collection of classes that wrap fundamental data types that exist in Perl. These classes and methods as they exist today are an attempt to mirror functionality provided by Moose’s Native Traits. One important thing to note is all classes currently do no validation on constructor input.

Data::Perl is a container class for the following classes:
o Data::Perl::Collection::Hash
o Data::Perl::Collection::Array
o Data::Perl::String
o Data::Perl::Number
o Data::Perl::Counter
o Data::Perl::Bool
o Data::Perl::Code

ALPHA API

The API provided by these modules is as of now considered alpha and undecided. The API <B>WILLB> change. If you are writing code that you will not touch again for years, do not use this until this warning is removed.

PROVIDED FUNCTIONS

Data::Perl exports helper constructor functions to interface with the above classes:
o <B>hash(key, value, ...)B>

Returns a Data::Perl::Collection::Hash object initialized with the optionally passed in key/value args.

o <B>array(@args)B>

Returns a Data::Perl::Collection::Array object initialized with the optionally passed in values.

o <B>string($arg)B>

Returns a Data::Perl::String object initialized with the optionally passed in scalar arg.

o <B>number($arg)B>

Returns a Data::Perl::Number object initialized with the optionally passed in scalar arg.

o <B>counter($arg)B>

Returns a Data::Perl::Counter object initialized with the optionally passed in scalar arg.

o <B>bool($arg)B>

Returns a Data::Perl::Bool object initialized with the truth value of the passed in scalar arg.

o <B>code($arg)B>

Returns a Data::Perl::Code object initialized with the optionally passed in scalar coderef as an arg.

THANKS

Much thanks to the Moose team for their work with native traits, for which much of this work is based.

SEE ALSO

o MooX::HandlesVia

AUTHOR

Matthew Phillips <mattp@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.

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

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


perl v5.20.3 DATA::PERL (3) 2014-06-27

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