Perl: the Markov chain saw 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?
 [Corion]: ambrus: Details ;) [ambrus]: Like { package AnyEvent::Impl:: Prima; use Prima; sub io{ my(\$s,%r)=@_; Prima::File->new( file=>\$r{fh},mask =>("w"eq\$r{poll}? fe::Write():fe:: Read())|fe:: Exception,onRead =>\$r{cb},onWrite =>\$r{cb}, onException=>\$r{cb }) } sub timer { ... } push @AnyEvent::REGI [ambrus]: argh, too long, let me try on scratchpad [Corion]: . o O ( I seem to have improved my skills of getting other people to write code for me )

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2016-12-08 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
On a regular basis, I'm most likely to spy upon:

Results (141 votes). Check out past polls.