-
-
31 May 2015 22:28:45 UTC
- Distribution: List-Slice
- Module version: 0.003
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (482 / 0 / 0)
- Kwalitee
Bus factor: 1- 100.00% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (59.97KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- none
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
List::Slice - Slice-like operations on lists
VERSION
version 0.003
SYNOPSIS
use List::Slice qw( head tail );
DESCRIPTION
This module provides functions for slicing lists. This is helpful when you want to do a chain of manipulations on a list (map, grep, sort) and then slice, without the cumbersome
(...)[x]
syntax.FUNCTIONS
head
my @values = head $size, @list;
Returns the first
$size
elements from@list
. If$size
is negative, returns all but the last$size
elements from@list
.@result = head 2, qw( foo bar baz ); # foo, bar @result = head -2, qw( foo bar baz ); # foo
tail
my @values = tail $size, @list;
Returns the last
$size
elements from@list
. If$size
is negative, returns all but the first$size
elements from@list
.@result = tail 2, qw( foo bar baz ); # bar, baz @result = tail -2, qw( foo bar baz ); # baz
SEE ALSO
List::Util, List::MoreUtils, List::UtilsBy
AUTHOR
Doug Bell <preaction@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install List::Slice, copy and paste the appropriate command in to your terminal.
cpanm List::Slice
perl -MCPAN -e shell install List::Slice
For more information on module installation, please visit the detailed CPAN module installation guide.