foo
[gitmo/Moose-Autobox.git] / lib / Moose / Autobox / String.pm
index 09d63a6..718410e 100644 (file)
@@ -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] : ()) }
@@ -39,12 +42,12 @@ Moose::Autobox::String - the String role
 
 =head1 DESCRIPTION
 
+This is a role to describes a String value.
+
 =head1 METHODS
 
 =over 4
 
-=item B<meta>
-
 =item B<chomp>
 
 =item B<chop>
@@ -65,6 +68,12 @@ Moose::Autobox::String - the String role
 
 =back
 
+=over 4
+
+=item B<meta>
+
+=back
+
 =head1 BUGS
 
 All complex software has bugs lurking in it, and this module is no