Venus
view release on metacpan or search on metacpan
lib/Venus/Range.pm view on Meta::CPAN
my $select = $range->select;
# ['a', 'b']
=back
=over 4
=item select example 3
package main;
use Venus::Range;
my $range = Venus::Range->parse('0:', ['a'..'i']);
my $select = $range->select;
# ['a'..'i']
=back
=over 4
=item select example 4
package main;
use Venus::Range;
my $range = Venus::Range->parse(':-2', ['a'..'i']);
my $select = $range->select;
# ['a'..'h']
=back
=over 4
=item select example 5
package main;
use Venus::Range;
my $range = Venus::Range->parse('2:8:2', ['a'..'i']);
my $select = $range->select;
# ['c', 'e', 'g', 'i']
=back
=cut
=head2 split
split(number $index) (tuple[arrayref, arrayref])
The split method splits the elements into two sets of elements at the index
specific and returns a tuple of two arrayrefs. The first arrayref will include
everything L<"before"|/before> the index provided, and the second tuple will
include everything L<"after"|/after> the index provided. This operation will
always exclude the element at the index the elements are split on. See
L</partition> for an inclusive split operation.
I<Since C<4.15>>
=over 4
=item split example 1
# given: synopsis
package main;
my $split = $range->split;
# [[], ['b'..'i']]
=back
=over 4
=item split example 2
# given: synopsis
package main;
my $split = $range->split(0);
# [[], ['a'..'i']]
=back
=over 4
=item split example 3
# given: synopsis
package main;
my $split = $range->split(5);
# [['a'..'e'], ['g'..'i']]
=back
=cut
=head1 AUTHORS
Awncorp, C<awncorp@cpan.org>
=cut
=head1 LICENSE
( run in 1.624 second using v1.01-cache-2.11-cpan-71847e10f99 )