Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: A better (ie.more concise) way to write this?

by BrowserUk (Patriarch)
on Dec 13, 2013 at 16:22 UTC ( [id://1067038]=note: print w/replies, xml ) Need Help??


in reply to Re: A better (ie.more concise) way to write this?
in thread A better (ie.more concise) way to write this?

That'll do nicely. Thank you.


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.
  • Comment on Re^2: A better (ie.more concise) way to write this?

Replies are listed 'Best First'.
Re^3: A better (ie.more concise) way to write this?
by greengaroo (Hermit) on Dec 16, 2013 at 16:13 UTC

    Why not this:

    for ( @a ) { ++$_; $_ %= 10 }

    And if you really want to process only the first 10, you can still use the slice:

    for ( @a[0..9] ) { ++$_; $_ %= 10 }


    A for will get you from A to Z; a while will get you everywhere.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found