.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Data::Perl 3" .TH Data::Perl 3 2024-09-01 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Data::Perl \- Base classes wrapping fundamental Perl data types. .SH VERSION .IX Header "VERSION" version 0.002011 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& 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; # (\*(Aqa\*(Aq, \*(Aqb\*(Aq); \& \& my $number = number(5); \& \& $number\->add(10); # 15 \& \& my $string = string("foo\en"); \& \& $string\->chomp; # return 1, chomps string \& \& my $counter = counter(); \& \& $counter\->inc; # counter is now 1 \& \& my $sub = code(sub { \*(Aqfoo\*(Aq }); \& \& $sub\->execute; # returns \*(Aqfoo\*(Aq \& \& $foo .Ve .SH DESCRIPTION .IX Header "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. .PP Data::Perl is a container class for the following classes: .IP \(bu 4 Data::Perl::Collection::Hash .IP \(bu 4 Data::Perl::Collection::Array .IP \(bu 4 Data::Perl::String .IP \(bu 4 Data::Perl::Number .IP \(bu 4 Data::Perl::Counter .IP \(bu 4 Data::Perl::Bool .IP \(bu 4 Data::Perl::Code .SH "ALPHA API" .IX Header "ALPHA API" The API provided by these modules is as of now considered alpha and undecided. The API \fBWILL\fR change. If you are writing code that you will not touch again for years, do not use this until this warning is removed. .SH "PROVIDED FUNCTIONS" .IX Header "PROVIDED FUNCTIONS" Data::Perl exports helper constructor functions to interface with the above classes: .IP \(bu 4 \&\fBhash(key, value, ...)\fR .Sp Returns a Data::Perl::Collection::Hash object initialized with the optionally passed in key/value args. .IP \(bu 4 \&\fBarray(@args)\fR .Sp Returns a Data::Perl::Collection::Array object initialized with the optionally passed in values. .IP \(bu 4 \&\fBstring($arg)\fR .Sp Returns a Data::Perl::String object initialized with the optionally passed in scalar arg. .IP \(bu 4 \&\fBnumber($arg)\fR .Sp Returns a Data::Perl::Number object initialized with the optionally passed in scalar arg. .IP \(bu 4 \&\fBcounter($arg)\fR .Sp Returns a Data::Perl::Counter object initialized with the optionally passed in scalar arg. .IP \(bu 4 \&\fBbool($arg)\fR .Sp Returns a Data::Perl::Bool object initialized with the truth value of the passed in scalar arg. .IP \(bu 4 \&\fBcode($arg)\fR .Sp Returns a Data::Perl::Code object initialized with the optionally passed in scalar coderef as an arg. .SH THANKS .IX Header "THANKS" Much thanks to the Moose team for their work with native traits, for which much of this work is based. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP \(bu 4 MooX::HandlesVia .SH AUTHOR .IX Header "AUTHOR" Matthew Phillips .SH MAINTAINER .IX Header "MAINTAINER" Toby Inkster since version 0.002010. .SH CONTRIBUTORS .IX Header "CONTRIBUTORS" .IP \(bu 4 Graham Knop .IP \(bu 4 Jon Portnoy .IP \(bu 4 kristof.pap@gmail.com .IP \(bu 4 Matt Phillips .IP \(bu 4 Toby Inkster .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2020 by Matthew Phillips . .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.