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

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

Serving Software Downloads in 976 Categories, Downloaded 29.546.741 Times

List::Search 0.3

  Date Added: November 19, 2010  |  Visits: 677

List::Search

Report Broken Link
Printer Friendly Version


Product Homepage
Download (70 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  -  List::Util 1.19
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...
44.03 KB  
Libraries  -  List::Intersperse 1.00
List::Intersperse Perl module can intersperse / unsort / disperse a list. SYNOPSIS use List::Intersperse qw/intersperseq/; @ispersed = intersperseq {substr($_[0],0,1)} qw/A1 A2 B1 B2 C1 C2/; @ispersed = List::Intersperse::intersperse qw/A...
2.05 KB  
Libraries  -  DBI::Changes 1.58
DBI::Changes Perl module contains a list of significant changes to the DBI..
491.52 KB  
Libraries  -  Linux::Distribution::Packages 0.05
Linux::Distribution::Packages Perl module contains a list all packages on various Linux distributions. SYNOPSIS use Linux::Distribution::Packages qw(distribution_packages distribution_write); $linux = new...
4.1 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  -  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  -  Convert::Wiki::Node::Item 0.05
Convert::Wiki::Node::Item is a Perl module that represents an item in a list (aka or *). SYNOPSIS use Convert::Wiki::Node::Item; my $para = Convert::Wiki::Node->new( txt => Foo is a foobar., type => item ); print $para->as_wiki(); #...
19.46 KB  
Libraries  -  SNMP::Multi 2.1
SNMP::Multi is a Perl module to perform SNMP operations on multiple hosts simultaneously. SYNOPSIS use SNMP::Multi; my $req = SNMP::Multi::VarReq->new ( nonrepeaters => 1, hosts => [ qw/ router1.my.com router2.my.com / ], vars => [ [...
25.6 KB  
Libraries  -  XML::DOM::XML_Base 0.02
XML::DOM::XML_Base Perl module can apply xml:base to attribute values. SYNOPSIS use XML::DOM::XML_Base; my $parser = XML::DOM::Parser->new(); my $xml = qq( ); # build the DOM my $dom = $parser->parse( $xml ); # get some...
3.07 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
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  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB