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.232.093 Times

List::Search 0.3

  Date Added: November 19, 2010  |  Visits: 955

List::Search

Report Broken Link
Printer Friendly Version


Product Homepage
Download (88 downloads)



List::Search is a Perl module for fast searching of sorted lists. SYNOPSIS use List::Search qw( list_search nlist_search custom_list_search ); # Create a list to search my @list = sort qw( bravo charlie delta ); # Search for a value, returns the index of first match print list_search( alpha, @list ); # 0 print list_search( charlie, @list ); # 1 print list_search( zebra, @list ); # -1 # Search numerically my @numbers = sort { $a <=> $b } ( 10, 20, 100, 200, ); print nlist_search( 20, @numbers ); # 2 # Search using some other comparison my $cmp_code = sub { lc( $_[0] ) cmp lc( $_[1] ) }; my @custom_list = sort { $cmp_code->( $a, $b ) } qw( FOO bar BAZ bundy ); print list_search_generic( $cmp_code, foo, @custom_list ); This module lets you quickly search a sorted list. It will return the index of the first entry that matches, or if there is no exact matches then the first entry that is greater than the search key. For example in the list my @list = qw( bob dave fred ); searching for dave will return 1 as $list[1] eq dave. Searching for charles will also return 1 as dave is the first entry that is greater than charles. If there are none of the entries match then -1 is returned. You can either check for this or use it as an index to get the last values in the list. Whichever approach you choose will depend on what you are trying to do. The actual searching is done using a binary search which is very fast..

Requirements: No special requirements
Platforms: Linux
Keyword: Fast Searching Libraries List Listsearch Perl Module Print Print List Programming Search Searching Sorted
Users rating: 0/10

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


LIST::SEARCH RELATED
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Libraries  -  HTTP::Browscap 0.02
HTTP::Browscap is a Perl module that can parse and search browscap.ini files. SYNOPSIS use HTTP::Browscap; my $capable = browscap(); if( $capable->{wap} ) { output_WAP(); } if( $capable->{css} > 1 ) { # Browser can handle CSS2 } #...
9.22 KB  
Libraries  -  SVN::Log::Index 0.51
SVN::Log::Index is a Perl module that can index and search over Subversion commit logs. SYNOPSIS my $index = SVN::Log::Index->new({ index_path => /path/to/index }); if($creating) { # Create from scratch if necessary $index->create({...
13.31 KB  
Libraries  -  Env::Path 0.18
Env::Path is a Perl module with advanced operations on path variables. SYNOPSIS use Env::Path; # basic usage my $manpath = Env::Path->MANPATH; $manpath->Append(/opt/samba/man); for ($manpath->List) { print $_, "n" }; # similar to above...
10.24 KB  
Libraries  -  Scrape::USPS::ZipLookup Perl Module 2.4
The United States Postal Service (USPS) has on its web site an HTML form at http://www.usps.com/zip4/ for standardizing an address. Given a firm, urbanization, street address, city, state, and zip, it will put the address into standard form...
11.26 KB  
Libraries  -  Statistics::TTest 1.1.0
Statistics::TTest is a Perl module to perform T-test on 2 independent samples. Statistics::TTest::Sufficient - Perl module to perfrom T-Test on 2 indepdent samples using sufficient statistics SYNOPSIS #example for Statistics::TTest use...
6.14 KB  
Programming  -  Perl Module Manager 1.2.0.18
Perl Module Manager helps you to install, un-install and manage Perl modules from a CPAN site and other sources in an easy and intuitive way. Allows you to search through thousands of useful modules and libraries on a CPAN site and its mirrors....
1.44 MB  
Libraries  -  Math::Combinatorics 0.09
Math::Combinatorics is a Perl module that can perform combinations and permutations on lists. SYNOPSIS Available as an object oriented API. use Math::Combinatorics; my @n = qw(a b c); my $combinat = Math::Combinatorics->new(count => 2,...
10.24 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