Moose::Autobox::Scalar - the Scalar role


Moose-Autobox documentation Contained in the Moose-Autobox distribution.

Index


Code Index:

NAME

Top

Moose::Autobox::Scalar - the Scalar role

DESCRIPTION

Top

This is a role to describes a Scalar value, which is defined as the combination (union sort of) of a String and a Number.

METHODS

Top

meta
print
say
flatten

Flattening a scalar just returns the scalar. This means that you can say:

  my @array = $input->flatten;

  # Given $input of 5, @array is (5);
  # Given $input of [ 5, 2, 0], @array is (5, 2, 0)

first

As per flatten.

last

As per flatten.

BUGS

Top

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Top

Stevan Little <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Top


Moose-Autobox documentation Contained in the Moose-Autobox distribution.

package Moose::Autobox::Scalar;
use Moose::Role 'with';

our $VERSION = '0.11';

with 'Moose::Autobox::String',
     'Moose::Autobox::Number';     

sub flatten { $_[0] }
sub first { $_[0] }
sub last  { $_[0] }
sub print { CORE::print $_[0] }
sub say   { CORE::print $_[0], "\n" }
1;

__END__