From: Stevan Little Date: Sat, 10 Jun 2006 00:57:54 +0000 (+0000) Subject: foo X-Git-Tag: 0_02~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=680d0745246bc4ced8656e91f3768ef1645983b1;p=gitmo%2FMoose-Autobox.git foo --- diff --git a/lib/Moose/Autobox/Indexed.pm b/lib/Moose/Autobox/Indexed.pm index 3380993..2ea4bec 100644 --- a/lib/Moose/Autobox/Indexed.pm +++ b/lib/Moose/Autobox/Indexed.pm @@ -3,14 +3,12 @@ use Moose::Role 'requires'; our $VERSION = '0.01'; -requires qw/ - at - put - exists - keys - values - kv -/; +requires 'at'; +requires 'put'; +requires 'exists'; +requires 'keys'; +requires 'values'; +requires 'kv'; 1; diff --git a/lib/Moose/Autobox/List.pm b/lib/Moose/Autobox/List.pm index 1aabd28..9ab4c99 100644 --- a/lib/Moose/Autobox/List.pm +++ b/lib/Moose/Autobox/List.pm @@ -7,16 +7,14 @@ our $VERSION = '0.01'; with 'Moose::Autobox::Value'; -requires qw/ - head - tail - length - join - grep - map - sort - reverse -/; +requires 'head'; +requires 'tail'; +requires 'length'; +requires 'join'; +requires 'grep'; +requires 'map'; +requires 'sort'; +requires 'reverse'; sub reduce { my ($array, $func) = @_; diff --git a/lib/Moose/Autobox/String.pm b/lib/Moose/Autobox/String.pm index 9ddda09..718410e 100644 --- a/lib/Moose/Autobox/String.pm +++ b/lib/Moose/Autobox/String.pm @@ -15,7 +15,10 @@ sub chomp { CORE::chomp $_[0] } sub chop { CORE::chop $_[0] } sub reverse { CORE::reverse $_[0] } sub length { CORE::length $_[0] } -sub index { CORE::index $_[0], $_[1], (defined $_[2] ? $_[2] : ()) } +sub index { + return CORE::index($_[0], $_[1]) if scalar @_ == 2; + return CORE::index($_[0], $_[1], $_[2]); +} # FIXME: this is not working #sub rindex { CORE::rindex $_[0], $_[1], (defined $_[2] ? $_[2] : ()) }