Code Monkey home page Code Monkey logo

data-perl's Introduction

NAME

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

VERSION

version 0.002011

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:

ALPHA API

The API provided by these modules is as of now considered alpha and undecided. The API WILL 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:

  • hash(key, value, ...)

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

  • array(@args)

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

  • string($arg)

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

  • number($arg)

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

  • counter($arg)

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

  • bool($arg)

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

  • code($arg)

    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

AUTHOR

Matthew Phillips [email protected]

MAINTAINER

Toby Inkster [email protected] since version 0.002010.

CONTRIBUTORS

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by Matthew Phillips [email protected].

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

data-perl's People

Contributors

tobyink avatar haarg avatar avenj avatar josebadoe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.