Skip to content
This repository
Newer
Older
100644 1034 lines (700 sloc) 32.932 kb
59613c69 »
2010-03-19 removed ^H based formatting
1 NAME
eb1e820a » jarich
2012-06-30 New version
2 autobox::Core - Provide core functions to autoboxed scalars, arrays and
3 hashes.
6071da23 » Scott Walters
2004-03-30 initial import of autobox::Core 0.1 from CPAN
4
59613c69 »
2010-03-19 removed ^H based formatting
5 SYNOPSIS
f7eb8980 » chocolateboy
2010-08-19 update README
6 use autobox::Core;
6071da23 » Scott Walters
2004-03-30 initial import of autobox::Core 0.1 from CPAN
7
f7eb8980 » chocolateboy
2010-08-19 update README
8 "Hello, World\n"->uc->print;
6071da23 » Scott Walters
2004-03-30 initial import of autobox::Core 0.1 from CPAN
9
eb1e820a » jarich
2012-06-30 New version
10 my @list = (1, 5, 9, 2, 0, 4, 2, 1);
11 @list->sort->reverse->print;
12
13 # works with references too!
14 my $list = [1, 5, 9, 2, 0, 4, 2, 1];
15 $list->sort->reverse->print;
16
17 my %hash = (
18 grass => 'green',
19 apple => 'red',
20 sky => 'blue',
21 );
22
23 use feature qw(say); # Use print and a newline in older versions of Perl
24
25 [10, 20, 30, 40, 50]->pop->say;
26 [10, 20, 30, 40, 50]->shift->say;
27
28 my $lala = "Lalalalala\n";
29 "chomp: "->concat($lala->chomp, " ", $lala)->say;
30
31 my $hashref = { foo => 10, bar => 20, baz => 30, qux => 40 };
32
33 print "hash keys: ", $hashref->keys->join(' '), "\n"; # or if you prefer...
34 print "hash keys: ", join ' ', $hashref->keys(), "\n"; # or
35 print "hash keys: "; $hashref->keys->say;
36
59613c69 »
2010-03-19 removed ^H based formatting
37 DESCRIPTION
eb1e820a » jarich
2012-06-30 New version
38 The autobox module promotes Perl's primitive types (literals (strings
39 and numbers), scalars, arrays and hashes) into first-class objects.
40 However, autobox does not provide any methods for these new classes.
41
42 autobox::CORE provides a set of methods for these new classes. It
43 includes almost everything in perlfunc, some things from Scalar::Util
44 and List::Util, and some Perl 5 versions of methods taken from Perl 6.
6071da23 » Scott Walters
2004-03-30 initial import of autobox::Core 0.1 from CPAN
45
eb1e820a » jarich
2012-06-30 New version
46 With autobox::Core one is able to change this:
6071da23 » Scott Walters
2004-03-30 initial import of autobox::Core 0.1 from CPAN
47
eb1e820a » jarich
2012-06-30 New version
48 print join(" ", reverse(split(" ", $string)));
6071da23 » Scott Walters
2004-03-30 initial import of autobox::Core 0.1 from CPAN
49
eb1e820a » jarich
2012-06-30 New version
50 to this:
6071da23 » Scott Walters
2004-03-30 initial import of autobox::Core 0.1 from CPAN
51
eb1e820a » jarich
2012-06-30 New version
52 use autobox::Core;
53
54 $string->split(" ")->reverse->print;
55
56 Likewise you can change this:
57
58 my $array_ref = [qw(fish dog cat elephant bird)];
59
60 push @$array_ref, qw(snake lizard giraffe mouse);
61
62 to this:
63
64 use autobox::Core;
65 my $array_ref = [qw(fish dog cat elephant bird)];
66
67 $array_ref->push( qw(snake lizard giraffe mouse));
68
69 autobox::Core makes it easier to avoid parentheses pile ups and messy
70 dereferencing syntaxes.
71
72 autobox::Core is mostly glue. It presents existing functions with a new
73 interface, while adding few extra. Most of the methods read like `sub
74 hex { CORE::hex($_[0]) }'. In addition to built-ins from perlfunc that
75 operate on hashes, arrays, scalars, and code references, some Perl 6-ish
76 things have been included, and some keywords like `foreach' are
77 represented too.
6071da23 » Scott Walters
2004-03-30 initial import of autobox::Core 0.1 from CPAN
78
f7eb8980 » chocolateboy
2010-08-19 update README
79 What's Implemented?
eb1e820a » jarich
2012-06-30 New version
80 * All of the functions listed in perlfunc under the headings:
6071da23 » Scott Walters
2004-03-30 initial import of autobox::Core 0.1 from CPAN
81
eb1e820a » jarich
2012-06-30 New version
82 * "Functions for real @ARRAYs",
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
83
eb1e820a » jarich
2012-06-30 New version
84 * "Functions for real %HASHes",
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
85
eb1e820a » jarich
2012-06-30 New version
86 * "Functions for list data",
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
87
eb1e820a » jarich
2012-06-30 New version
88 * "Functions for SCALARs or strings"
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
89
eb1e820a » jarich
2012-06-30 New version
90 plus a few taken from other sections and documented below.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
91
eb1e820a » jarich
2012-06-30 New version
92 * Some methods from Scalar::Util and List::Util.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
93
eb1e820a » jarich
2012-06-30 New version
94 * Some things expected in Perl 6, such as `last' (`last_idx'),
95 `elems', and `curry'.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
96
eb1e820a » jarich
2012-06-30 New version
97 * `flatten' explicitly flattens an array.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
98
eb1e820a » jarich
2012-06-30 New version
99 * Functions such as `add' have been defined for numeric operations.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
100
eb1e820a » jarich
2012-06-30 New version
101 String Methods
102 String methods are of the form `my $return = $string->method(@args)'.
103 Some will act on the `$string' and some will return a new string.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
104
eb1e820a » jarich
2012-06-30 New version
105 Many string methods are simply wrappers around core functions, but there
106 are additional operations and modifications to core behavior.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
107
eb1e820a » jarich
2012-06-30 New version
108 Anything which takes a regular expression, such as split and m, usually
109 take it in the form of a compiled regex (`qr//'). Any modifiers can be
110 attached to the `qr' normally.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
111
eb1e820a » jarich
2012-06-30 New version
112 These built in functions are implemented for scalars, they work just
113 like normal: chomp, chop,chr crypt, index, lc lcfirst, length, ord,
114 pack, reverse (always in scalar context), rindex, sprintf, substr, uc
115 ucfirst, unpack, quotemeta, vec, undef, split, system, eval.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
116
eb1e820a » jarich
2012-06-30 New version
117 In addition, so are each of the following:
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
118
eb1e820a » jarich
2012-06-30 New version
119 concat
120 $string1->concat($string2);
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
121
eb1e820a » jarich
2012-06-30 New version
122 Concatenates `$string2' to `$string1'. This corresponds to the `.'
123 operator used to join two strings. Returns the joined strings.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
124
eb1e820a » jarich
2012-06-30 New version
125 strip
126 Removes whitespace from the beginning and end of a string.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
127
eb1e820a » jarich
2012-06-30 New version
128 " \t \n \t foo \t \n \t "->strip; # foo
129
130 This is redundant and subtly different from `trim' which allows for the
131 removal of specific characters from the beginning and end of a string.
132
133 trim
134 Removes whitespace from the beginning and end of a string. `trim' can
135 also remove specific characters from the beginning and the end of
136 string.
137
138 ' hello'->trim; # 'hello'
139 '*+* hello *+*'->trim("*+"); # ' hello '
140 ' *+* hello *+*'->trim("*+"); # ' *+* hello'
141
142 ltrim
143 Just like trim but it only trims the left side (start) of the string.
144
145 ' hello'->ltrim; # 'hello'
146 '*+* hello *+*'->trim("*+"); # ' hello *+*'
147
148 rtrim
149 Just like trim but it only trims the right side (end) of the string.
150
151 'hello '->rtrim; # 'hello'
152 '*+* hello *+*'->rtrim("*+"); # '*+* hello '
153
154 split
155 my @split_string = $string->split(qr/.../);
156
157 A wrapper around split. It takes the regular expression as a compiled
158 regex.
159
160 print "10, 20, 30, 40"->split(qr{, ?})->elements, "\n";
161 "hi there"->split(qr/ */); # h i t h e r e
162
163 The limit argument is not implemented.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
164
eb1e820a » jarich
2012-06-30 New version
165 title_case
166 `title_case' converts the first character of each word in the string to
167 upper case.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
168
eb1e820a » jarich
2012-06-30 New version
169 "this is a test"->title_case; # This Is A Test
170
171 center
f7eb8980 » chocolateboy
2010-08-19 update README
172 my $centered_string = $string->center($length);
173 my $centered_string = $string->center($length, $character);
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
174
f7eb8980 » chocolateboy
2010-08-19 update README
175 Centers $string between $character. $centered_string will be of length
eb1e820a » jarich
2012-06-30 New version
176 $length, or the length of $string, whichever is greater.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
177
eb1e820a » jarich
2012-06-30 New version
178 `$character' defaults to " ".
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
179
f7eb8980 » chocolateboy
2010-08-19 update README
180 say "Hello"->center(10); # " Hello ";
181 say "Hello"->center(10, '-'); # "---Hello--";
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
182
eb1e820a » jarich
2012-06-30 New version
183 `center()' will never truncate `$string'. If $length is less than
184 `$string->length' it will just return `$string'.
185
186 say "Hello"->center(4); # "Hello";
187
188 backtick
189 my $output = $string->backtick;
190
191 Runs $string as a command just like ``$string`'.
192
193 nm
194 if( $foo->nm(qr/bar/) ) {
195 say "$foo did not match 'bar'";
196 }
197
198 "Negative match". Corresponds to `!~'. Otherwise works in the same way
199 as `m()'.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
200
eb1e820a » jarich
2012-06-30 New version
201 m
202 if( $foo->m(qr/bar/) ) {
203 say "$foo matched 'bar'";
204 }
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
205
eb1e820a » jarich
2012-06-30 New version
206 my $matches = $foo->m( qr/(\d*) (\w+)/ );
207 say $matches->[0];
208 say $matches->[1];
209
210 Works the same as `m//', but the regex must be passed in as a `qr//'.
211
212 `m' returns an array reference so that list functions such as `map' and
213 `grep' may be called on the result. Use `elements' to turn this into a
214 list of values.
215
216 my ($street_number, $street_name, $apartment_number) =
217 "1234 Robin Drive #101"->m( qr{(\d+) (.*)(?: #(\d+))?} )->elements;
218
219 print "$street_number $street_name $apartment_number\n";
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
220
eb1e820a » jarich
2012-06-30 New version
221 s
222 my $string = "the cat sat on the mat";
223 $string->s( qr/cat/, "dog" );
224 $string->say; # the dog sat on the mat
225
226 Works the same as `s///'. Returns the number of substitutions performed,
227 not the target string.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
228
eb1e820a » jarich
2012-06-30 New version
229 undef
230 $string->undef;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
231
eb1e820a » jarich
2012-06-30 New version
232 Assigns `undef' to the `$string'.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
233
eb1e820a » jarich
2012-06-30 New version
234 defined
235 my $is_defined = $string->defined;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
236
eb1e820a » jarich
2012-06-30 New version
237 if( not $string->defined ) {
238 # give $string a value...
239 }
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
240
eb1e820a » jarich
2012-06-30 New version
241 `defined' tests whether a value is defined (not `undef').
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
242
eb1e820a » jarich
2012-06-30 New version
243 repeat
244 my $repeated_string = $string->repeat($n);
245
246 Like the `x' operator, repeats a string `$n' times.
247
248 print 1->repeat(5); # 11111
249 print "\n"->repeat(10); # ten newlines
250
251 I/O Methods
252 These are methods having to do with input and ouptut, not filehandles.
253
254 print
255 $string->print;
256
257 Prints a string or a list of strings. Returns true if successful.
258
259 say
260 Like print, but implicitly appends a newline to the end.
261
262 $string->say;
263
264 Boolean Methods
265 Methods related to boolean operations.
266
267 and
268 `and' corresponds to `&&'. Returns true if both operands are true.
269
270 if( $a->and($b) ) {
271 ...
272 }
273
274 not
275 `not' corresponds to `!'. Returns true if the subject is false.
276
277 if( $a->not ) {
278 ...
279 }
280
281 or
282 `or' corresponds to `||'. Returns true if at least one of the operands
283 is true.
284
285 if( $a->or($b) ) {
286 ...
287 }
288
289 xor
290 `xor' corresponds to `xor'. Returns true if only one of the operands is
291 true.
292
293 if( $a->xor($b) ) {
294 ...
295 }
296
297 Number Related Methods
298 Methods related to numbers.
299
300 The basic built in functions which operate as normal : abs, atan2, cos,
301 exp, int, log, oct, hex, sin, and sqrt.
302
303 The following operators were also included:
304
305 dec
306 $number->dec();
307 # $number is smaller by 1.
308
309 `dec' corresponds to `++'. Decrements subject, will decrement character
310 strings too: 'b' decrements to 'a'.
311
312 inc
313 `inc' corresponds to `++'. Increments subject, will increment character
314 strings too. 'a' increments to 'b'.
315
316 mod
317 `mod' corresponds to `%'.
318
319 $number->mod(5);
320
321 pow
322 `pow' returns $number raised to the power of the $exponent.
323
324 my $result = $number->pow($expontent);
325 print 2->pow(8); # 256
326
327 is_number
f7eb8980 » chocolateboy
2010-08-19 update README
328 $is_a_number = $thing->is_number;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
329
eb1e820a » jarich
2012-06-30 New version
330 Returns true if $thing is a number as understood by Perl.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
331
f7eb8980 » chocolateboy
2010-08-19 update README
332 12.34->is_number; # true
333 "12.34"->is_number; # also true
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
334
eb1e820a » jarich
2012-06-30 New version
335 is_positive
f7eb8980 » chocolateboy
2010-08-19 update README
336 $is_positive = $thing->is_positive;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
337
f7eb8980 » chocolateboy
2010-08-19 update README
338 Returns true if $thing is a positive number.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
339
eb1e820a » jarich
2012-06-30 New version
340 `0' is not positive.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
341
eb1e820a » jarich
2012-06-30 New version
342 is_negative
f7eb8980 » chocolateboy
2010-08-19 update README
343 $is_negative = $thing->is_negative;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
344
f7eb8980 » chocolateboy
2010-08-19 update README
345 Returns true if $thing is a negative number.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
346
eb1e820a » jarich
2012-06-30 New version
347 `0' is not negative.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
348
eb1e820a » jarich
2012-06-30 New version
349 is_integer
f7eb8980 » chocolateboy
2010-08-19 update README
350 $is_an_integer = $thing->is_integer;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
351
f7eb8980 » chocolateboy
2010-08-19 update README
352 Returns true if $thing is an integer.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
353
f7eb8980 » chocolateboy
2010-08-19 update README
354 12->is_integer; # true
355 12.34->is_integer; # false
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
356
eb1e820a » jarich
2012-06-30 New version
357 is_int
358 A synonym for is_integer.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
359
eb1e820a » jarich
2012-06-30 New version
360 is_decimal
f7eb8980 » chocolateboy
2010-08-19 update README
361 $is_a_decimal_number = $thing->is_decimal;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
362
f7eb8980 » chocolateboy
2010-08-19 update README
363 Returns true if $thing is a decimal number.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
364
f7eb8980 » chocolateboy
2010-08-19 update README
365 12->is_decimal; # false
366 12.34->is_decimal; # true
367 ".34"->is_decimal; # true
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
368
eb1e820a » jarich
2012-06-30 New version
369 Reference Related Methods
370 The following core functions are implemented.
371
372 tie, tied, ref, vec.
373
374 `tie', `tied', and `undef' don't work on code references.
375
376 Array Methods
f7eb8980 » chocolateboy
2010-08-19 update README
377 Array methods work on both arrays and array references:
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
378
f7eb8980 » chocolateboy
2010-08-19 update README
379 my $arr = [ 1 .. 10 ];
380 $arr->undef;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
381
f7eb8980 » chocolateboy
2010-08-19 update README
382 Or:
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
383
f7eb8980 » chocolateboy
2010-08-19 update README
384 my @arr = [ 1 .. 10 ];
385 @arr->undef;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
386
f7eb8980 » chocolateboy
2010-08-19 update README
387 List context forces methods to return a list:
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
388
f7eb8980 » chocolateboy
2010-08-19 update README
389 my @arr = ( 1 .. 10 );
390 print join ' -- ', @arr->grep(sub { $_ > 3 }), "\n";
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
391
eb1e820a » jarich
2012-06-30 New version
392 Likewise, scalar context forces methods to return an array reference.
393
394 As scalar context forces methods to return a reference, methods may be
395 chained
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
396
f7eb8980 » chocolateboy
2010-08-19 update README
397 my @arr = ( 1 .. 10 );
eb1e820a » jarich
2012-06-30 New version
398 @arr->grep(sub { $_ > 3 })->min->say; # "1\n";
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
399
eb1e820a » jarich
2012-06-30 New version
400 These built-in functions are defined as methods:
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
401
eb1e820a » jarich
2012-06-30 New version
402 pop, push, shift, unshift, delete, undef, exists, bless, tie, tied, ref,
403 grep, map, join, reverse, and sort, each,
404
405 vdelete
406 Deletes a specified value from the array.
407
408 $a = 1->to(10);
409 $a->vdelete(3); # deletes 3
410 $a->vdelete(2)->say; # "1 4 5 6 7 8 9 10\n"
411
412 uniq
413 Removes all duplicate elements from an array and returns the new array
414 with no duplicates.
415
416 my @array = qw( 1 1 2 3 3 6 6 );
417 @return = @array->uniq; # @return : 1 2 3 6
418
419 first
420 Returns the first element of an array for which a callback returns true:
421
422 $arr->first(sub { qr/5/ });
423
424 max
425 Returns the largest numerical value in the array.
426
427 $a = 1->to(10);
428 $a->max; # 10
429
430 min
431 Returns the smallest numerical value in the array.
432
433 $a = 1->to(10);
434 $a->min; # 1
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
435
eb1e820a » jarich
2012-06-30 New version
436 mean
437 Returns the mean of elements of an array.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
438
eb1e820a » jarich
2012-06-30 New version
439 $a = 1->to(10);
440 $a->mean; # 55/10
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
441
eb1e820a » jarich
2012-06-30 New version
442 var
443 Returns the variance of the elements of an array.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
444
eb1e820a » jarich
2012-06-30 New version
445 $a = 1->to(10);
446 $a->var; # 33/4
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
447
eb1e820a » jarich
2012-06-30 New version
448 svar
449 Returns the standard variance.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
450
eb1e820a » jarich
2012-06-30 New version
451 $a = 1->to(10);
452 $a->svar; # 55/6
453
454 at
455 Returns the element at a specified index. This function does not modify
456 the original array.
457
458 $a = 1->to(10);
459 $a->at(2); # 3
460
461 size
462 See length().
463
464 elems
465 See length().
466
467 length
468 `size', `elems' and `length' all return the number of elements in an
469 array.
470
471 my @array = qw(foo bar baz);
472 @array->size; # 3
473
474 elements
475 See `flatten'.
476
477 flatten
478 my @copy_of_array = $array->flatten;
479
480 Returns the elements of an array ref as an array. This is the same as
481 `@{$array}'.
482
483 Arrays can be iterated on using `for' and `foreach'. Both take a code
484 reference as the body of the for statement.
485
486 foreach
487 @array->foreach(\&code);
488
489 Calls `&code' on each element of the @array in order. &code gets the
490 element as its argument.
491
492 @array->foreach(sub { print $_[0] }); # print each element of the array
493
494 for
495 @array->for(\&code);
496
497 Like foreach, but `&code' is called with the index, the value and the
498 array itself.
499
500 my $arr = [ 1 .. 10 ];
501 $arr->for(sub {
502 my($idx, $value) = @_;
503 print "Value #$idx is $value\n";
504 });
505
506 sum
507 my $sum = @array->sum;
508
509 Adds together all the elements of the array.
510
511 count
512 Returns the number of elements in array that are `eq' to a specified
513 value:
514
515 my @array = qw/one two two three three three/;
516 my $num = @array->count('three'); # returns 3
517
518 to, upto, downto
519 `to', `upto', and `downto' create array references:
520
521 1->to(5); # creates [1, 2, 3, 4, 5]
522 1->upto(5); # creates [1, 2, 3, 4, 5]
523 5->downto(5); # creates [5, 4, 3, 2, 1]
524
525 Those wrap the `..' operator.
526
527 Note while working with negative numbers you need to use () so as to
528 avoid the wrong evaluation.
529
530 my $range = 10->to(1); # this works
531 my $range = -10->to(10); # wrong, interpreted as -( 10->to(10) )
532 my $range = (-10)->to(10); # this works
533
534 head
535 Returns the first element from `@list'. This differs from shift in that
536 it does not change the array.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
537
f7eb8980 » chocolateboy
2010-08-19 update README
538 my $first = @list->head;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
539
eb1e820a » jarich
2012-06-30 New version
540 tail
541 Returns all but the first element from `@list'.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
542
f7eb8980 » chocolateboy
2010-08-19 update README
543 my @list = qw(foo bar baz quux);
544 my @rest = @list->tail; # [ 'bar', 'baz', 'quux' ]
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
545
eb1e820a » jarich
2012-06-30 New version
546 Optionally, you can pass a number as argument to ask for the last `$n'
f7eb8980 » chocolateboy
2010-08-19 update README
547 elements:
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
548
f7eb8980 » chocolateboy
2010-08-19 update README
549 @rest = @list->tail(2); # [ 'baz', 'quux' ]
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
550
eb1e820a » jarich
2012-06-30 New version
551 slice
552 Returns a list containing the elements from `@list' at the indices
553 `@indices'. In scalar context, returns an array reference.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
554
eb1e820a » jarich
2012-06-30 New version
555 # Return $list[1], $list[2], $list[4] and $list[8].
556 my @sublist = @list->slice(1,2,4,8);
557
558 range
559 `range' returns a list containing the elements from `@list' with indices
560 ranging from `$lower_idx' to `$upper_idx'. It returns an array reference
561 in scalar context.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
562
f7eb8980 » chocolateboy
2010-08-19 update README
563 my @sublist = @list->range( $lower_idx, $upper_idx );
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
564
eb1e820a » jarich
2012-06-30 New version
565 last_index
566 my $index = @array->last_index(qr/.../);
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
567
eb1e820a » jarich
2012-06-30 New version
568 Returns the highest index whose element matches the given regular
569 expression.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
570
eb1e820a » jarich
2012-06-30 New version
571 my $index = @array->last_index(\&filter);
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
572
eb1e820a » jarich
2012-06-30 New version
573 Returns the highest index for an element on which the filter returns
574 true. The &filter is passed in each value of the @array.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
575
eb1e820a » jarich
2012-06-30 New version
576 my @things = qw(pear poll potato tomato);
f7eb8980 » chocolateboy
2010-08-19 update README
577 my $last_p = @things->last_index(qr/^p/); # 2
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
578
eb1e820a » jarich
2012-06-30 New version
579 Called with no arguments, it corresponds to `$#array' giving the highest
580 index of the array.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
581
eb1e820a » jarich
2012-06-30 New version
582 my $index = @array->last_index;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
583
eb1e820a » jarich
2012-06-30 New version
584 first_index
585 Works just like last_index but it will return the index of the *first*
586 matching element.
587
588 my $first_index = @array->first_index; # 0
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
589
eb1e820a » jarich
2012-06-30 New version
590 my @things = qw(pear poll potato tomato);
f7eb8980 » chocolateboy
2010-08-19 update README
591 my $last_p = @things->first_index(qr/^t/); # 3
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
592
eb1e820a » jarich
2012-06-30 New version
593 at
594 my $value = $array->at($index);
595
596 Equivalent to `$array->[$index]'.
597
598 Hash Methods
599 Hash methods work on both hashes and hash references.
600
601 The built in functions work as normal:
602
603 delete, exists, keys, values, bless, tie, tied, ref, undef,
604
605 at
606 See `at'.
607
608 get
609 my @values = %hash->get(@keys);
610
611 Returns the @values of @keys.
612
613 put
614 %hash->put(%other_hash);
615
616 Overlays %other_hash on top of %hash.
617
618 my $h = {a => 1, b => 2};
619 $h->put(b => 99, c => 3); # (a => 1, b => 99, c => 3)
620
621 set
622 Synonym for put.
623
624 each
625 Like `foreach' but for hash references. For each key in the hash, the
626 code reference is invoked with the key and the corresponding value as
627 arguments:
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
628
f7eb8980 » chocolateboy
2010-08-19 update README
629 my $hashref = { foo => 10, bar => 20, baz => 30, quux => 40 };
630 $hashref->each(sub { print $_[0], ' is ', $_[1], "\n" });
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
631
eb1e820a » jarich
2012-06-30 New version
632 Or:
633
634 my %hash = ( foo => 10, bar => 20, baz => 30, quux => 40 );
635 %hash->each(sub { print $_[0], ' is ', $_[1], "\n" });
636
637 Unlike regular `each', this each will always iterate through the entire
638 hash.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
639
eb1e820a » jarich
2012-06-30 New version
640 Hash keys appear in random order that varies from run to run (this is
641 intentional, to avoid calculated attacks designed to trigger algorithmic
642 worst case scenario in `perl''s hash tables).
643
644 You can get a sorted `foreach' by combining `keys', `sort', and
645 `foreach':
646
647 %hash->keys->sort->foreach(sub {
648 print $_[0], ' is ', $hash{$_[0]}, "\n";
649 });
650
651 lock_keys
652 %hash->lock_keys;
653
654 Works as Hash::Util. No more keys may be added to the hash.
655
656 slice
657 Takes a list of hash keys and returns the corresponding values e.g.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
658
f7eb8980 » chocolateboy
2010-08-19 update README
659 my %hash = (
660 one => 'two',
661 three => 'four',
662 five => 'six'
663 );
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
664
f7eb8980 » chocolateboy
2010-08-19 update README
665 print %hash->slice(qw(one five))->join(' and '); # prints "two and six"
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
666
eb1e820a » jarich
2012-06-30 New version
667 flip
668 Exchanges values for keys in a hash:
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
669
f7eb8980 » chocolateboy
2010-08-19 update README
670 my %things = ( foo => 1, bar => 2, baz => 5 );
671 my %flipped = %things->flip; # { 1 => foo, 2 => bar, 5 => baz }
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
672
f7eb8980 » chocolateboy
2010-08-19 update README
673 If there is more than one occurence of a certain value, any one of the
674 keys may end up as the value. This is because of the random ordering of
675 hash keys.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
676
f7eb8980 » chocolateboy
2010-08-19 update README
677 # Could be { 1 => foo }, { 1 => bar }, or { 1 => baz }
678 { foo => 1, bar => 1, baz => 1 }->flip;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
679
eb1e820a » jarich
2012-06-30 New version
680 Because references cannot usefully be keys, it will not work where the
681 values are references.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
682
f7eb8980 » chocolateboy
2010-08-19 update README
683 { foo => [ 'bar', 'baz' ] }->flip; # dies
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
684
eb1e820a » jarich
2012-06-30 New version
685 flatten
686 my %hash = $hash_ref->flatten;
687
688 Dereferences a hash reference.
689
690 Code Methods
691 Methods which work on code references.
692
693 These are simple wrappers around the Perl core functions. bless, ref,
694
695 Due to Perl's precedence rules, some autoboxed literals may need to be
696 parenthesized. For instance, this works:
697
698 my $curried = sub { ... }->curry();
699
700 This does not:
701
702 my $curried = \&foo->curry();
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
703
eb1e820a » jarich
2012-06-30 New version
704 The solution is to wrap the reference in parentheses:
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
705
eb1e820a » jarich
2012-06-30 New version
706 my $curried = (\&foo)->curry();
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
707
eb1e820a » jarich
2012-06-30 New version
708 curry
709 my $curried_code = $code->curry(5);
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
710
eb1e820a » jarich
2012-06-30 New version
711 Currying takes a code reference and provides the same code, but with the
712 first argument filled in.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
713
eb1e820a » jarich
2012-06-30 New version
714 my $greet_world = sub {
715 my($greeting, $place) = @_;
716 return "$greeting, $place!";
717 };
718 print $greet_world->("Hello", "world"); # "Hello, world!"
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
719
eb1e820a » jarich
2012-06-30 New version
720 my $howdy_world = $greet_world->curry("Howdy");
721 print $howdy_world->("Texas"); # "Howdy, Texas!"
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
722
f7eb8980 » chocolateboy
2010-08-19 update README
723 What's Missing?
eb1e820a » jarich
2012-06-30 New version
724 * File and socket operations are already implemented in an
725 object-oriented fashion care of IO::Handle, IO::Socket::INET, and
726 IO::Any.
727
728 * Functions listed in the perlfunc headings
729
730 * "System V interprocess communication functions",
731
732 * "Fetching user and group info",
733
734 * "Fetching network info",
735
736 * "Keywords related to perl modules",
737
738 * "Functions for processes and process groups",
739
740 * "Keywords related to scoping",
741
742 * "Time-related functions",
743
744 * "Keywords related to the control flow of your perl program",
745
746 * "Functions for filehandles, files, or directories",
747
748 * "Input and output functions".
749
750 * (Most) binary operators
751
752 These things are likely implemented in an object oriented fashion by
753 other CPAN modules, are keywords and not functions, take no arguments,
754 or don't make sense as part of the string, number, array, hash, or code
755 API.
f7eb8980 » chocolateboy
2010-08-19 update README
756
757 Autoboxing
758 *This section quotes four pages from the manuscript of Perl 6 Now: The
eb1e820a » jarich
2012-06-30 New version
759 Core Ideas Illustrated with Perl 5 by Scott Walters. The text appears in
760 the book starting at page 248. This copy lacks the benefit of copyedit -
761 the finished product is of higher quality.*
f7eb8980 » chocolateboy
2010-08-19 update README
762
763 A *box* is an object that contains a primitive variable. Boxes are used
eb1e820a » jarich
2012-06-30 New version
764 to endow primitive types with the capabilities of objects which
f7eb8980 » chocolateboy
2010-08-19 update README
765 essential in strongly typed languages but never strictly required in
eb1e820a » jarich
2012-06-30 New version
766 Perl. Programmers might write something like `my $number = Int->new(5)'.
f7eb8980 » chocolateboy
2010-08-19 update README
767 This is manual boxing. To *autobox* is to convert a simple type into an
768 object type automatically, or only conceptually. This is done by the
eb1e820a » jarich
2012-06-30 New version
769 language.
770
771 *autobox*ing makes a language look to programmers as if everything is an
f7eb8980 » chocolateboy
2010-08-19 update README
772 object while the interpreter is free to implement data storage however
773 it pleases. Autoboxing is really making simple types such as numbers,
774 strings, and arrays appear to be objects.
775
eb1e820a » jarich
2012-06-30 New version
776 `int', `num', `bit', `str', and other types with lower case names, are
f7eb8980 » chocolateboy
2010-08-19 update README
777 primitives. They're fast to operate on, and require no more memory to
eb1e820a » jarich
2012-06-30 New version
778 store than the data held strictly requires. `Int', `Num', `Bit', `Str',
f7eb8980 » chocolateboy
2010-08-19 update README
779 and other types with an initial capital letter, are objects. These may
780 be subclassed (inherited from) and accept traits, among other things.
781 These objects are provided by the system for the sole purpose of
782 representing primitive types as objects, though this has many ancillary
eb1e820a » jarich
2012-06-30 New version
783 benefits such as making `is' and `has' work. Perl provides `Int' to
784 encapsulate an `int', `Num' to encapsulate a `num', `Bit' to encapsulate
785 a `bit', and so on. As Perl's implementations of hashes and dynamically
f7eb8980 » chocolateboy
2010-08-19 update README
786 expandable arrays store any type, not just objects, Perl programmers
787 almost never are required to box primitive types in objects. Perl's
788 power makes this feature less essential than it is in other languages.
789
eb1e820a » jarich
2012-06-30 New version
790 *autobox*ing makes primitive objects and they're boxed versions
791 equivalent. An `int' may be used as an `Int' with no constructor call,
792 no passing, nothing. This applies to constants too, not just variables.
793 This is a more Perl 6 way of doing things.
f7eb8980 » chocolateboy
2010-08-19 update README
794
795 # Perl 6 - autoboxing associates classes with primitives types:
eb1e820a » jarich
2012-06-30 New version
796
f7eb8980 » chocolateboy
2010-08-19 update README
797 print 4.sqrt, "\n";
798
799 print [ 1 .. 20 ].elems, "\n";
800
801 The language is free to implement data storage however it wishes but the
802 programmer sees the variables as objects.
803
804 Expressions using autoboxing read somewhat like Latin suffixes. In the
805 autoboxing mind-set, you might not say that something is "made more
806 mnemonic", but has been "mnemonicified".
807
808 Autoboxing may be mixed with normal function calls. In the case where
809 the methods are available as functions and the functions are available
810 as methods, it is only a matter of personal taste how the expression
811 should be written:
812
813 # Calling methods on numbers and strings, these three lines are equivalent
814 # Perl 6
815
816 print sqrt 4;
817 print 4.sqrt;
818 4.sqrt.print;
819
eb1e820a » jarich
2012-06-30 New version
820 The first of these three equivalents assumes that a global `sqrt()'
f7eb8980 » chocolateboy
2010-08-19 update README
821 function exists. This first example would fail to operate if this global
eb1e820a » jarich
2012-06-30 New version
822 function were removed and only a method in the `Num' package was left.
f7eb8980 » chocolateboy
2010-08-19 update README
823
824 Perl 5 had the beginnings of autoboxing with filehandles:
825
826 use IO::Handle;
827 open my $file, '<', 'file.txt' or die $!;
828 $file->read(my $data, -s $file);
829
eb1e820a » jarich
2012-06-30 New version
830 Here, `read' is a method on a filehandle we opened but *never blessed*.
831 This lets us say things like `$file->print(...)' rather than the often
832 ambagious `print $file ...'.
f7eb8980 » chocolateboy
2010-08-19 update README
833
eb1e820a » jarich
2012-06-30 New version
834 To many people, much of the time, it makes more conceptual sense as
835 well.
f7eb8980 » chocolateboy
2010-08-19 update README
836
eb1e820a » jarich
2012-06-30 New version
837 Reasons to Box Primitive Types
f7eb8980 » chocolateboy
2010-08-19 update README
838 What good is all of this?
839
eb1e820a » jarich
2012-06-30 New version
840 * Makes conceptual sense to programmers used to object interfaces as
841 *the* way to perform options.
842
843 * Alternative idiom. Doesn't require the programmer to write or read
844 expressions with complex precedence rules or strange operators.
845
846 * Many times that parenthesis would otherwise have to span a large
847 expression, the expression may be rewritten such that the
848 parenthesis span only a few primitive types.
849
850 * Code may often be written with fewer temporary variables.
851
852 * Autoboxing provides the benefits of boxed types without the memory
853 bloat of actually using objects to represent primitives. Autoboxing
854 "fakes it".
855
856 * Strings, numbers, arrays, hashes, and so on, each have their own
857 API. Documentation for an `exists' method for arrays doesn't have to
858 explain how hashes are handled and vice versa.
859
860 * Perl tries to accommodate the notion that the "subject" of a
861 statement should be the first thing on the line, and autoboxing
862 furthers this agenda.
f7eb8980 » chocolateboy
2010-08-19 update README
863
864 Perl is an idiomatic language and this is an important idiom.
865
eb1e820a » jarich
2012-06-30 New version
866 Subject First: An Aside
f7eb8980 » chocolateboy
2010-08-19 update README
867 Perl's design philosophy promotes the idea that the language should be
868 flexible enough to allow programmers to place the of a statement first.
eb1e820a » jarich
2012-06-30 New version
869 For example, `die $! unless read $file, 60' looks like the primary
870 purpose of the statement is to `die'.
871
872 While that might be the programmers primary goal, when it isn't, the
873 programmer can communicate his real primary intention to programmers by
874 reversing the order of clauses while keeping the exact same logic: `read
875 $file, 60 or die $!'.
876
877 Autoboxing is another way of putting the subject first.
878
879 Nouns make good subjects, and in programming, variables, constants, and
880 object names are the nouns. Function and method names are verbs.
881 `$noun->verb()' focuses the readers attention on the thing being acted
882 on rather than the action being performed. Compare to `$verb($noun)'.
883
884 Autoboxing and Method Results
885 Let's look at some examples of ways an expression could be written.
f7eb8980 » chocolateboy
2010-08-19 update README
886
887 # Various ways to do the same thing:
888
889 print(reverse(sort(keys(%hash)))); # Perl 5 - pathological parenthetic
890 print reverse sort keys %hash; # Perl 5 - no unneeded parenthesis
891
892 print(reverse(sort(%hash,keys)))); # Perl 6 - pathological
893 print reverse sort %hash.keys; # Perl 6 - no unneeded parenthesis
894
895 %hash.keys ==> sort ==> reverse ==> print; # Perl 6 - pipeline operator
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
896
f7eb8980 » chocolateboy
2010-08-19 update README
897 %hash.keys.sort.reverse.print; # Perl 6 - autobox
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
898
f7eb8980 » chocolateboy
2010-08-19 update README
899 %hash->keys->sort->reverse->print; # Perl 5 - autobox
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
900
f7eb8980 » chocolateboy
2010-08-19 update README
901 This section deals with the last two of these equivalents. These are
eb1e820a » jarich
2012-06-30 New version
902 method calls
903
904 use autobox::Core;
905 use Perl6::Contexts;
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
906
f7eb8980 » chocolateboy
2010-08-19 update README
907 my %hash = (foo => 'bar', baz => 'quux');
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
908
f7eb8980 » chocolateboy
2010-08-19 update README
909 %hash->keys->sort->reverse->print; # Perl 5 - autobox
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
910
f7eb8980 » chocolateboy
2010-08-19 update README
911 # prints "foo baz"
912
913 Each method call returns an array reference, in this example. Another
914 method call is immediately performed on this value. This feeding of the
915 next method call with the result of the previous call is the common mode
916 of use of autoboxing. Providing no other arguments to the method calls,
917 however, is not common.
918
eb1e820a » jarich
2012-06-30 New version
919 `Perl6::Contexts' recognizes object context as provided by `->' and
920 coerces `%hash' and `@array' into references, suitable for use with
921 `autobox'. (Note that `autobox' also does this automatically as of
922 version 2.40.)
f7eb8980 » chocolateboy
2010-08-19 update README
923
eb1e820a » jarich
2012-06-30 New version
924 `autobox' associates primitive types, such as references of various
925 sorts, with classes. `autobox::Core' throws into those classes methods
926 wrapping Perl's built-in functions. In the interest of full disclosure,
927 `Perl6::Contexts' and `autobox::Core' are my creations.
928
929 Autobox to Simplify Expressions
f7eb8980 » chocolateboy
2010-08-19 update README
930 One of my pet peeves in programming is parenthesis that span large
931 expression. It seems like about the time I'm getting ready to close the
932 parenthesis I opened on the other side of the line, I realize that I've
933 forgotten something, and I have to arrow back over or grab the mouse.
eb1e820a » jarich
2012-06-30 New version
934
f7eb8980 » chocolateboy
2010-08-19 update README
935 When the expression is too long to fit on a single line, it gets broken
936 up, then I must decide how to indent it if it grows to 3 or more lines.
937
938 # Perl 5 - a somewhat complex expression
939
940 print join("\n", map { CGI::param($_) } @cgi_vars), "\n";
941 # Perl 5 - again, using autobox:
942
943 @cgi_vars->map(sub { CGI::param($_[0]) })->join("\n")->concat("\n")->print;
944
945 The autoboxed version isn't shorter, but it reads from left to right,
eb1e820a » jarich
2012-06-30 New version
946 and the parenthesis from the `join()' don't span nearly as many
947 characters. The complex expression serving as the value being `join()'ed
f7eb8980 » chocolateboy
2010-08-19 update README
948 in the non-autoboxed version becomes, in the autoboxed version, a value
eb1e820a » jarich
2012-06-30 New version
949 to call the `join()' method on.
f7eb8980 » chocolateboy
2010-08-19 update README
950
eb1e820a » jarich
2012-06-30 New version
951 This `print' statement takes a list of CGI parameter names, reads the
f7eb8980 » chocolateboy
2010-08-19 update README
952 values for each parameter, joins them together with newlines, and prints
953 them with a newline after the last one.
954
955 Pretending that this expression were much larger and it had to be broken
956 to span several lines, or pretending that comments are to be placed
957 after each part of the expression, you might reformat it as such:
958
959 @cgi_vars->map(sub { CGI::param($_[0]) }) # turn CGI arg names into values
960 ->join("\n") # join with newlines
961 ->concat("\n") # give it a trailing newline
962 ->print; # print them all out
963
964 This could also have been written:
965
966 sub { CGI::param($_[0]) }->map(@cgi_vars) # turn CGI arg names into values
967 ->join("\n") # join with newlines
968 ->concat("\n") # give it a trailing newline
969 ->print; # print them all out
970
eb1e820a » jarich
2012-06-30 New version
971 `map()' is .
972
973 The `map()' method defined in the `autobox::Core::CODE' package takes
974 for its arguments the things to map. The `map()' method defined in the
975 `autobox::Core::ARRAY' package takes for its argument a code reference
976 to apply to each element of the array.
f7eb8980 » chocolateboy
2010-08-19 update README
977
978 *Here ends the text quoted from the Perl 6 Now manuscript.*
979
980 BUGS
eb1e820a » jarich
2012-06-30 New version
981 Yes. Report them to the author, scott@slowass.net, or post them to
982 GitHub's bug tracker at https://github.com/scrottie/autobox-Core/issues.
983
984 The API is not yet stable -- Perl 6-ish things and local extensions are
985 still being renamed.
f7eb8980 » chocolateboy
2010-08-19 update README
986
987 HISTORY
988 See the Changes file.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
989
59613c69 »
2010-03-19 removed ^H based formatting
990 COPYRIGHT AND LICENSE
eb1e820a » jarich
2012-06-30 New version
991 Copyright (C) 2009, 2010, 2011 by Scott Walters and various contributors
992 listed (and unlisted) below.
f7eb8980 » chocolateboy
2010-08-19 update README
993
994 This library is free software; you can redistribute it and/or modify it
995 under the same terms as Perl itself, either Perl version 5.8.9 or, at
996 your option, any later version of Perl 5 you may have available.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
997
f7eb8980 » chocolateboy
2010-08-19 update README
998 This library is distributed in the hope that it will be useful, but
999 without any warranty; without even the implied warranty of
1000 merchantability or fitness for a particular purpose.
4f721cf1 »
2010-03-05 tidying before release... version number correction; doc fixes;
1001
59613c69 »
2010-03-19 removed ^H based formatting
1002 SEE ALSO
f7eb8980 » chocolateboy
2010-08-19 update README
1003 autobox
1004 Moose::Autobox
1005 Perl6::Contexts
eb1e820a » jarich
2012-06-30 New version
1006 http://github.com/gitpan/autobox-Core
f7eb8980 » chocolateboy
2010-08-19 update README
1007 IO::Any
eb1e820a » jarich
2012-06-30 New version
1008 Perl 6: http://dev.perl.org/perl6/apocalypse/.
f7eb8980 » chocolateboy
2010-08-19 update README
1009
1010 AUTHORS
1011 Scott Walters, scott@slowass.net.
1012
1013 Michael Schwern and the perl5i contributors for tests, code, and
1014 feedback.
1015
eb1e820a » jarich
2012-06-30 New version
1016 JJ contributed a `strip' method for scalars - thanks JJ!
f7eb8980 » chocolateboy
2010-08-19 update README
1017
1018 Ricardo SIGNES contributed patches.
1019
1020 Thanks to Matt Spear, who contributed tests and definitions for numeric
1021 operations.
1022
1023 Mitchell N Charity reported a bug and sent a fix.
1024
1025 Thanks to chocolateboy for autobox and for the encouragement.
1026
1027 Thanks to Bruno Vecchi for bug fixes and many, many new tests going into
1028 version 0.8.
1029
eb1e820a » jarich
2012-06-30 New version
1030 Thanks to http://github.com/daxim daxim/Lars DIECKOW pushing in fixes
f7eb8980 » chocolateboy
2010-08-19 update README
1031 and patches from the RT queue along with fixes to build and additional
1032 doc examples.
eb1e820a » jarich
2012-06-30 New version
1033
1034 Jacinta Richardson improved documentation.
1035
Something went wrong with that request. Please try again.