Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I start wondering if there are any array assignment "tricks" to assign and modify in one fell swoop. For instance to add the elements of two arrays to each othermy ($dd, $mm, $yyyy) = (localtime)[3..5]; $mm += 1; $yyyy += 1900;
or in a similar fashion concat the elements...fake code: @result = (1,2,3) + (4,5,6); # intending @result to contain (5,7,9)
Thanks for any insights
L
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: array assignment
by kvale (Monsignor) on Nov 12, 2004 at 19:59 UTC | |
by Roy Johnson (Monsignor) on Nov 13, 2004 at 02:55 UTC | |
|
Re: array assignment
by dragonchild (Archbishop) on Nov 12, 2004 at 19:50 UTC | |
|
Re: array assignment
by fglock (Vicar) on Nov 12, 2004 at 19:32 UTC | |
by etj (Priest) on Jun 22, 2022 at 19:57 UTC | |
|
Re: array assignment
by Anonymous Monk on Nov 13, 2004 at 18:41 UTC | |
by hippo (Archbishop) on Jun 23, 2022 at 09:16 UTC | |
|
Re: array assignment
by TedPride (Priest) on Nov 12, 2004 at 19:50 UTC |