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

Array::Each::Tutorial 0.02

  Date Added: January 13, 2010  |  Visits: 1.430


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  
HTML Utilities  -  TrafficSharky 1.0
You wanted this ever since you made the decision to make money online. So why is this your money making savior? Easy. Because generating traffic to a website is the critical element to making money online. Do you want to learn secret tactics to...
1.44 MB  
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, 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  -  wolfSSL 3.12.2
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...
2.73 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