Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Regarding arrays

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


in reply to Regarding arrays

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!


Comment on Re: Regarding arrays
Download Code
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}

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://616983]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2014-08-01 22:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (51 votes), past polls