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];In reply to Re^2: A better (ie.more concise) way to write this?
by Anonymous Monk
in thread A better (ie.more concise) way to write this?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |