Permalink
Browse files

Added a 3-argument version of 'split'.

  • Loading branch information...
1 parent f4b1cd6 commit 5a00418d55fb3341a8b3ea37fa965ef177b77949 @angelortega committed Jan 11, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 Art5.pm
View
@@ -491,6 +491,11 @@ sub init {
$self->{op}->{size} = sub { return scalar @{$self->exec($_[0])} };
$self->{op}->{split} = sub {
+ if (scalar(@_) == 3) {
+ return [ map { [ split($self->exec($_[1]), $_) ] }
+ split($self->exec($_[0]), $self->exec($_[2]))
+ ];
+ }
return [ split($self->exec($_[0]), $self->exec($_[1])) ];
};

0 comments on commit 5a00418

Please sign in to comment.