Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: iterations in a hash

by BrowserUk (Pope)
on Aug 04, 2013 at 15:06 UTC ( #1047800=note: print w/replies, xml ) Need Help??

in reply to iterations in a hash

That is an inherently recursive process:

sub crossMul{ my( $r, $first ) = ( shift, shift ); print "$first * $_ = ", $r->{$first} * $r->{$_} for @_; crossMul( $r, @_ ) if @_ > 1; };; %hash=( A=>4, B=>5, C=>10, D=>2, E=>9 );; crossMul( \%hash, sort keys %hash );; A * B = 20 A * C = 40 A * D = 8 A * E = 36 B * C = 50 B * D = 10 B * E = 45 C * D = 20 C * E = 90 D * E = 18

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047800]
[Corion]: ... that can use templates from the HTML (via <script language="text/ template">... my template ...</script> and otherwise gets out of my way. But it seems that is not how the Javascript world is, currently :-/
[Corion]: I guess my question is, has anybody worked with React, Ember, Angular (v2, v4, v.whatever) or any other JS client-side dynamic rendering/virtual DOM thingie and found a simple, single-file solution like jQuery?

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2017-03-27 19:05 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (321 votes). Check out past polls.