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

Array::Each::Tutorial 0.02

  Date Added: January 13, 2010  |  Visits: 1.453


Report Broken Link
Printer Friendly Version

Product Homepage
Download (103 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
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  
Music  -  Bahia FM 1.3.0
A Bahia FM e a radio que esta ligada no povo da Bahia. Desde 2007 no ar, pode ser sintonizada no primeiro dial FM, o 88,7. Com um perfil popular, tendo como publico -alvo pessoas das classes C,D e E, de idades entre 20 e 40 anos, a Bahia FM...
3 MB  
Productivity  -  Ultimate Tuner
Ultimate Tuner is an application to help you tune your guitar. It plays standard tuning notes (E, A, G, D, B, e.) Features: Guitar Tuning. Plays standard notes E, A, G, D, B, and e. Select from two different notations: Letter...
5 MB  
Utilities  -  Chrome Piano 1.0.4
Chrome Piano is a simple HTML5 powered piano with basic C, D, E, F, G, A and B keys that play the appropriate piano sound when clicked. Keyboard support will be available in the next version.
3.71 MB  
Reference  -  Engineer Dictionary
Having an Engineer Dictionary is always important if you have to do with engineering a lot. Engineer Dictionary is a collection of engineer word definitions that will help you to understand what something is or how it works. If you want to know...
3 MB  
Travel  -  ezTrains
ezTrains is an application that displays the schedules of trains that pass through your station in real time All suburban lines of the Ile-de-France are supported (A, B, C, D, E, H, J, K, L, N, P, R, U), RER and Transilien! To go...
2 MB  
Travel  -  FranciTrains
FranciTrains is an application that displays the schedules of trains that pass through your station in real time All suburban lines of the Ile-de-France are supported (A, B, C, D, E, H, J, K, L, N, P, R, U), RER and Transilien! To...
2 MB  
Productivity  -  Hitung IPK
aplikasi ini adalah aplikasi penghitung ip(index prestasi) anda.. cara menggunakan : masukan data pada kolom jumlah sks dalam bentuk angka, dan Bobot Nilai dalam bentuk huruf a,b,c,d,e setelah itu, tekan tombol tambah Nilai untuk melihat...
1024 KB  
Productivity  -  Scale Finder Lite
This program helps to find Musical Scales matching the criteria you supply. An Example, you can set the degrees of a Scale like: 1st Degree: C 4th Degree: F# Prgram fill find Lydian Scale as matching pattern. C D E F# G A B...
1024 KB  
Automation Tools  -  IdealAutomate
Ideal Automate allows one to automate almost any task. It does this by making it possible for you to write scripts that can find images on the screen. By finding an image on the screen, you are able to locate where you want to read or write...
801 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 3.15.3
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