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

Array::Each::Tutorial 0.02

  Date Added: January 13, 2010  |  Visits: 1.905

Array::Each::Tutorial

Report Broken Link
Printer Friendly Version


Product Homepage
Download (121 downloads)



Array::Each::Tutorial - POD giving various examples how to use Array::Each. SYNOPSIS man Array::Each man Array::Each::Tutorial or perldoc Array::Each perldoc Array::Each::Tutorial Overview This tutorial contains only POD, so dont do this: use Array::Each::Tutorial; # dont do this Rather, simply read the POD (as you are doing). But first, please read the docs for Array::Each, because the whole scoop is there. This tutorial is intended to augment those docs with examples showing situations where you might want to use Array::Each instead of other techniques. EXAMPLES Parallel Arrays vs. Using a Hash First of all, use a hash. Its almost always the best solution if you want to associate a "key" with a "value". And there are modules available that will let you do wonderful things with hashes, like keeping the keys sorted or keeping them in the order they were added. So given a hash, you might at some point want to do this: my %h = ( a=>1, b=>2, c=>3, d=>4, e=>5 ); while( my( $k, $v ) = each %h ) { # ... do something with $k and $v ... } On the other hand, if parallel arrays better implement your algorithm, then you may find you want to do something like this: my @k = qw( a b c d e ); my @v = qw( 1 2 3 4 5 ); for my $i ( 0 .. $#k ) { my( $k, $v ) = ( $k[$i], $v[$i] ); # ... do something with $k and $v (and maybe $i) ... } Using Array::Each, you could do the same thing this way: use Array::Each; my @k = qw( a b c d e ); my @v = qw( 1 2 3 4 5 ); my $obj = Array::Each->new( @k, @v ); while( my( $k, $v, $i ) = $obj->each ) { # ... do something with $k and $v (and maybe $i) ... } If you dont need $i at all, you can leave it out, e.g., while( my( $k, $v ) = $obj->each ) { # ... do something with $k and $v ... } If you have more than two parallel arrays, include them all in the call to new() and add as many "capture" variables as you need, e.g., my @k = qw( a b c d e ); my @v = qw( 1 2 3 4 5 ); my @p = qw( - + ~ = : ); my $obj = Array::Each->new( @k, @v, @p ); while( my( $k, $v, $p, $i ) = $obj->each ) { # ... do something with $k, $v, and $p (and maybe $i) ... }.

Requirements: No special requirements
Platforms: Linux
Keyword: Arrayeachtutorial C D E Do Something Examples How To Pod Qw Something Want To
Users rating: 0/10

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


ARRAY::EACH::TUTORIAL RELATED
E-Mail Tools  -  How to Open OST File Free 1.0
Do not worry if you are looking for a reliable solution about how to open ost file, you have already found the response. The service of Microsoft Outlook recovery, provided by How to Open OST File Free, represents the fastest way out if you...
1.86 MB  
Home & Leisure  -  How To Make A Candy Bouquet 1.0
eBook showing how to make a candy bouquet, with pictures and detailed instructions.
768 KB  
Teaching Tools  -  How to draw a horse 5
How to draw a horse drawing game. A drawing activity for kids centered around their horse. In this section you will be learning how to draw a horse. You will draw the basic shapes to help you draw the horse. how to draw a face drawing game. free /...
10.24 KB  
Networking Tools  -  How To SEO Your Website 1.0
How To SEO Your Website in the Search Engine. Steps you can take to get Ranked. The best way to set up a website to get good internet search engine placement. Get more website traffic by making your site more attractive to Google and other search...
37 KB  
Utilities  -  How to change folder icon 1.4
How to change folder icon? Use this handy shell extension that enables you to quickly change folder icons to indicate a priority level or project status, or you can use it to mark a folder with a special icon or color of your choice. Right-click...
985 KB  
Libraries  -  Grid::Transform 0.02
Grid::Transform is a Perl module with fast grid transformations. SYNOPSIS use Grid::Transform; $g = Grid::Transform->new([a..o], rows=>5); $g->rotate_270->flip_vertical; print join( , $g->grid), "n"; The Grid::Transform module provides...
36.86 KB  
Puzzles  -  How To Win Your Ex Back - Puzzle 1.0
How To Win Your Ex Back; Breaking up can be one of the most difficult things that anyone can do. In fact if you find that you have just been dumped by your girlfriend or boyfriend and you want to know how to win your ex back; then you have come to...
685 KB  
Backup Utilities  -  How to View a SQL Database 1.0
Do you know that how to view a SQL database when these files damaged due to some unforeseen causes? If no, then get ready to view MDF files at free of cost with free SQL MDF viewer tool at SysTools. Corruption is an ever-growing problem which has...
1.61 MB  
Business  -  How to Generate Cash from Simply Writing Online! 9.0
Wouldn t you like to generate lots of cash writing from the comfort of your own home? In this hot report, you ll learn the following: font color="Blue"If you aren t using this software, it could be costing you both time and money. Professional...
2.07 MB  
Screen Savers  -  How To Make Money Today 1.1
Samsung has put out another top notch product with this new series of Telvisions. The Samsung LN46A750 46-Inch 1080p DLNA LCD HDTV with RED Touch of Color blows past other top name brands of High Definition Televisions. This High Definition...
1.11 MB  
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