1 package Moose::Autobox::Number;
6 with 'Moose::Autobox::Value';
9 return [ $_[0] .. $_[1] ] if $_[0] <= $_[1];
10 return [ reverse $_[1] .. $_[0] ];
21 Moose::Autobox::Number - the Number role
25 This is a role to describes a Numeric value.
33 Takes another number as argument and produces an array ranging from
34 the number the method is called on to the number given as argument. In
35 some situation, this method intentionally behaves different from the
36 range operator in perl:
38 $foo = [ 5 .. 1 ]; # $foo is []
40 $foo = 5->to(1); # $foo is [ 5, 4, 3, 2, 1 ]
52 All complex software has bugs lurking in it, and this module is no
53 exception. If you find a bug please either email me, or add the bug
58 Stevan Little E<lt>stevan@iinteractive.comE<gt>
60 =head1 COPYRIGHT AND LICENSE
62 Copyright 2006-2008 by Infinity Interactive, Inc.
64 L<http://www.iinteractive.com>
66 This library is free software; you can redistribute it and/or modify
67 it under the same terms as Perl itself.