Problems? Is your data what you think it is? PerlMonks

### Re: Regarding arrays

by Random_Walk (Prior)
 on May 23, 2007 at 11:55 UTC ( #616983=note: print w/replies, xml ) Need Help??

perl -le'@a1=qw(ME K LE K HT ME LL);@a2=qw(10 4 1 5 6 7 19);map{\$o{\$_}+=shift@a2}@a1;print"\$_=\$o{\$_}" for sort keys %o'

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

Replies are listed 'Best First'.
Re^2: Regarding arrays
by educated_foo (Vicar) on May 23, 2007 at 13:46 UTC
\$"="\n";\$_="@Array1\n";s/(?=\$")/"=".shift@Array2/eg;print

Nice but you did not sum the values assigned to each letter key, eg ME has 10 and 7 so the result should be 17 if I have understood editi's spec correctly.

```HT=6
K=9
LE=1
LL=19
ME=17

vs

ME=10
K=4
LE=1
K=5
HT=6
ME=7
LL=19

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!
Nice but you did not sum the values assigned to each letter key, eg ME has 10 and 7 so the result should be 17 if I have understood editi's spec correctly.
You probably guessed right, but what spec? editi's post is just gimme, now guess what I want.

--shmem

```_(\$_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
/\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.(\$e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;\$e.e && print}```

Create A New User
Node Status?
node history
Node Type: note [id://616983]
help
Chatterbox?
 [LanX]: hippo: I'm telling him constantly to upgrade to postgress...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2018-03-19 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
When I think of a mole I think of:

Results (238 votes). Check out past polls.

Notices?