Data::Unixish::List - Apply dux function to a list (and return the result as a list)
version 1.32
use Data::Unixish::List qw(dux); # no dux function arguments my @res = dux('sort', 3, 7, 1, 2); # => (1, 2, 3, 7) # specify dux function arguments my @res = dux([lpad => {width=>3, char=>'0'}], 3, 7, 1); # => ('003', '007', '001') # only retrieve the first row my @nums = (1, 2, 3, 4, "a", 5); my $sum = dux(sum => @nums); # => 15
Apply dux function $func to @data. Return the result list. If called in scalar context, return the first row of result list.
$func
@data
$func is either a string containing the name of dux function (without the Data::Unixish:: prefix) or a 2-element array like [$fname, \%args] where the first element is the dux function name and the second element contains the arguments for the function. If you do not need to pass any arguments/options to the dux function, you can use the simpler string version.
Data::Unixish::
[$fname, \%args]
None are exported by default, but they are exportable.
Data::Unixish::Apply
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2013 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Unixish, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Unixish
CPAN shell
perl -MCPAN -e shell install Data::Unixish
For more information on module installation, please visit the detailed CPAN module installation guide.