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 38.876.247 Times

Array::Each::Tutorial 0.02

  Date Added: January 13, 2010  |  Visits: 1.758


Report Broken Link
Printer Friendly Version

Product Homepage
Download (112 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
More Reviews or Write Review

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  
Information Lookup  -  How To Build Muscle 1.0
How to build muscle fast and avoid skinny guy mistakes. Free bodybuilding ebook that reveals the top 20 ways to screw up in the gym. Avoid these mistakes that almost every skinny guy makes.
2.49 MB  
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  
Education  -  Westminster C of E Primary School
Welcome to the Westminster C of E Primary School Smartphone App. This app is ideal for improving stakeholder engagement. It gives you the latest news, upcoming events, contact details and interactive surveys. The app sends a...
2 MB  
Sports  -  C.D. Amaya 2.1
Esta aplicacion de C.D. Amaya, permite reservar actividades o instalaciones para todos los socios de una manera sencilla. Con esta aplicacion en su dispositivo podra ver en tiempo real que pista puede reservar y hacerlo en cinco clicks....
3.6 MB  
Entertainment  -  How to Find Your Passion and Be Passionate
Every person has a passion. But not all people know what to do with their passion and some didn't even know what passion is and what the importance of passion in their lives is. If you need some tips on how to be passionate in something you...
3 MB  
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  
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