Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.181.553 Times

List::Util 1.19

  Date Added: September 11, 2010  |  Visits: 966

List::Util

Report Broken Link
Printer Friendly Version


Product Homepage
Download (102 downloads)



List::Util Perl module contains a selection of general-utility list subroutines. SYNOPSIS use List::Util qw(first max maxstr min minstr reduce shuffle sum); List::Util contains a selection of subroutines that people have expressed would be nice to have in the perl core, but the usage would not really be high enough to warrant the use of a keyword, and the size so small such that being individual extensions would be wasteful. By default List::Util does not export any subroutines. The subroutines defined are first BLOCK LIST Similar to grep in that it evaluates BLOCK setting $_ to each element of LIST in turn. first returns the first element where the result from BLOCK is a true value. If BLOCK never returns true or LIST was empty then undef is returned. $foo = first { defined($_) } @list # first defined value in @list $foo = first { $_ > $value } @list # first value in @list which # is greater than $value This function could be implemented using reduce like this $foo = reduce { defined($a) ? $a : wanted($b) ? $b : undef } undef, @list for example wanted() could be defined() which would return the first defined value in @list max LIST Returns the entry in the list with the highest numerical value. If the list is empty then undef is returned. $foo = max 1..10 # 10 $foo = max 3,9,12 # 12 $foo = max @bar, @baz # whatever This function could be implemented using reduce like this $foo = reduce { $a > $b ? $a : $b } 1..10 maxstr LIST Similar to max, but treats all the entries in the list as strings and returns the highest string as defined by the gt operator. If the list is empty then undef is returned. $foo = maxstr A..Z # Z $foo = maxstr "hello","world" # "world" $foo = maxstr @bar, @baz # whatever This function could be implemented using reduce like this $foo = reduce { $a gt $b ? $a : $b } A..Z min LIST Similar to max but returns the entry in the list with the lowest numerical value. If the list is empty then undef is returned. $foo = min 1..10 # 1 $foo = min 3,9,12 # 3 $foo = min @bar, @baz # whatever This function could be implemented using reduce like this $foo = reduce { $a < $b ? $a : $b } 1..10 minstr LIST Similar to min, but treats all the entries in the list as strings and returns the lowest string as defined by the lt operator. If the list is empty then undef is returned. $foo = minstr A..Z # A $foo = minstr "hello","world" # "hello" $foo = minstr @bar, @baz # whatever This function could be implemented using reduce like this $foo = reduce { $a lt $b ? $a : $b } A..Z reduce BLOCK LIST Reduces LIST by calling BLOCK, in a scalar context, multiple times, setting $a and $b each time. The first call will be with $a and $b set to the first two elements of the list, subsequent calls will be done by setting $a to the result of the previous call and $b to the next element in the list. Returns the result of the last call to BLOCK. If LIST is empty then undef is returned. If LIST only contains one element then that element is returned and BLOCK is not executed. $foo = reduce { $a < $b ? $a : $b } 1..10 # min $foo = reduce { $a lt $b ? $a : $b } aa..zz # minstr $foo = reduce { $a + $b } 1 .. 10 # sum $foo = reduce { $a . $b } @bar # concat shuffle LIST Returns the elements of LIST in a random order @cards = shuffle 0..51 # 0..51 in a random order sum LIST Returns the sum of all the elements in LIST. If LIST is empty then undef is returned. $foo = sum 1..10 # 55 $foo = sum 3,9,12 # 24 $foo = sum @bar, @baz # whatever This function could be implemented using reduce like this $foo = reduce { $a + $b } 1..10.

Requirements: No special requirements
Platforms: Linux
Keyword: Block First Foo If List Libraries Like This Listutil Perl Module Programming Reduce Returns Util Perl
Users rating: 0/10

License: Freeware Size: 44.03 KB
USER REVIEWS
More Reviews or Write Review


LIST::UTIL RELATED
Network & Internet  -  Links Like This 1.3
Links Like This is an extension for the Mozilla Firefox Web browser that helps you open sets of similar links in tabs all at once. When you right-click on a link and select "Open Links Like This???*A*" from the context menu, it...
10.24 KB  
Modules  -  More Like This 6.x-0.9 1.0
It supports an internal taxonomy search. This data is provided either as a block or as node properties to be manipulated during theming. It works by first specifying your "Thumbprint" for a particular node on the node edit form. By thumbprint we...
 
Modules  -  I Like This 1.7.1
This plugin allows your visitors to simply like your posts instead of comment it.You like this plugin? Donate!This plugin include * A counter/button to display the number of "like" and to vote. * A widget and a function to display the X most liked...
10 KB  
Modules  -  NS Like This 1.1
Get control over your content, check what your users most like with NS Like This, a plugin that allow your users to save their favorite posts, pages, categories or tags, and review it in their favorite private page, automatically created and...
81.92 KB  
Libraries  -  List::MoreUtils 0.22
List::MoreUtils is a Perl module that can provide the stuff missing in List::Util. SYNOPSIS use List::MoreUtils qw(any all none notall true false firstidx first_index lastidx last_index insert_after insert_after_string apply after after_incl...
22.53 KB  
Modules  -  Aggregation Block 6.x-1.2
This module provides a block to display a list of titles of recent articles from a feed created by the Aggregation module. A block may be created for each feed you have defined. Please note: this module will work only with feeds created by the...
10 KB  
Modules  -  WP Facebook Like This 0.6
This plugin allows your visitors to "like" your posts via new Facebook Like Function. You'll have to create a Facebook application to use this plugin.Installation :First part: Facebook side (FURTHER RELEASES, SKIP TO WORDPRESS SIDE) 1. First, you...
450.56 KB  
Libraries  -  Test::Unit::GTestRunner 0.04
Test::Unit::GTestRunner is a Unit testing framework helper class SYNOPSIS use Test::Unit::GTestRunner; Test::Unit::GTestRunner->new->start ($my_testcase_class); Test::Unit::GTestRunner::main ($my_testcase_class); If you just want to run...
63.49 KB  
E-Mail Tools  -  DBX Recovery Free 1.0
Get DBX Recovery Free if you'd like to know more about the process of dbx recovery, performed by this application. The recovery of email folders features some particularities that should be taken into consideration before choosing a solution for...
1.1 MB  
Development Tools  -  BOSS for C/C++ Library 0.45
It mainly consists of a rewrite of old DOS header files and libraries like Borland's graphics.h, bios.h and conio.h.This library includes support for sound and mouse features.BOSS stands for BGI Over SDL Subsystem.
40.96 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB