Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: how to avoid using index of array

by clueless newbie (Chaplain)
on Nov 13, 2011 at 13:55 UTC ( #937821=note: print w/replies, xml ) Need Help??


in reply to how to avoid using index of array

Use a hash?
use strict; use warnings; my @guys=qw(Tom Dick Harry); my @gals=qw(Jane Mary Pamela); # The real work ... my %marriages; @marriages{@guys}=@gals; for my $guy (keys %marriages) { print "$guy - $marriages{$guy}\n"; }
prints
Dick - Mary Harry - Pamela Tom - Jane

Replies are listed 'Best First'.
Re^2: how to avoid using index of array
by TomDLux (Vicar) on Nov 14, 2011 at 02:48 UTC

    Didn't you ever do first grade? Dick is with Jane and their baby is Spot.

    As Occam said: Entia non sunt multiplicanda praeter necessitatem.

      Now we know what D in TomDLux stands for :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://937821]
help
Chatterbox?
[Corion]: ... the browser(s) get a ping to a) refresh the page or b) reload "just" the changed parts, keeping the scroll position etc.
[Corion]: But I also have to look at how I can make WWW::Mechanize:: RemoteBrowser a reality, and how to make it safe from malicious content ;)
[Corion]: Part of wanting hot-reloading is that I think I've stumbled on a very simple set of CSS that I maybe want to use for a blog, but I want to try that out on mobile too, and I also want to add/modify it slightly so it has a header too...
[Corion]: ... and having hot reloading would make it easy to view the changes in multiple browser windows of different sizes, and on Android, simultaneously

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2018-04-26 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?