Steven Haryanto

NAME

Data::Unixish::List - Apply dux function to a list (and return the result as a list)

VERSION

version 1.32

SYNOPSIS

 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

DESCRIPTION

FUNCTIONS

dux($func, @data) => LIST (OR SCALAR)

Apply dux function $func to @data. Return the result list. If called in scalar context, return the first row of result list.

$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.

None are exported by default, but they are exportable.

SEE ALSO

Data::Unixish::Apply

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

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.