Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by Anonymous Monk
on Dec 13, 2013 at 17:35 UTC ( [id://1067051]=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?

Watch out, because

@b = map { ++$_ % 10 } @a;

modifies both @a and @b.

You can also do something like this:

$_ = ($_+1) % 10 for @a[3..7];

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-23 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found