Re: Merging Multiple Array elements
- From: Jürgen Exner <jurgenex@xxxxxxxxxxx>
- Date: Sun, 15 Jan 2012 12:45:54 -0800
Pradeep Patra <smilesonisamal@xxxxxxxxx> wrote:
The reason I need this requirement because I have something as
follows:
@array1 = returned by func1(i=0); [NOTE: this is just for illustration
not actual code]
@array2 = returned by func1(i=1);
I cannot change the func1(i); So I have to summing all the sub arrays
returned by func1(i) itself.
Any suggestions how to go about this?
Yes, several:
- If you really want to collect the individual return results before
summing them up then use an array of (references to) arrays as explained
before.
- with each iteration (i=0, i=1, ...) don't store the return result, but
add it to your grand total right away
- and last but not least: please post actual Perl code, not some
pseudo-code
jue
.
- References:
- Merging Multiple Array elements
- From: Pradeep Patra
- Re: Merging Multiple Array elements
- From: Henry Law
- Re: Merging Multiple Array elements
- From: Pradeep Patra
- Merging Multiple Array elements
- Prev by Date: Re: Merging Multiple Array elements
- Next by Date: Re: Merging Multiple Array elements
- Previous by thread: Re: Merging Multiple Array elements
- Next by thread: Re: Merging Multiple Array elements
- Index(es):
Relevant Pages
|