.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 3pm" .TH Data::Perl 3pm "2020-01-24" "perl v5.30.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 \s-1API\s0 provided by these modules is as of now considered alpha and undecided. The \s-1API\s0 \fB\s-1WILL\s0\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.