Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You have a (compound) variable that you want to increment and then modulate (ie. bound with modulus some number):
Instinct wants ++$a[$_] %= 10 for 0 .. 9; to work. It doesn't. Of course there is $a[$_] = ++$a[$_] % 10 for 0 .. 9;; which works, but is hardly better, especially when $a[$_] might be more like: . A better way? 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.
In reply to A better (ie.more concise) way to write this? by BrowserUk
|
|