snappybo has asked for the wisdom of the Perl Monks concerning the following question:
I didn't quite know how to label this one, but here's what i want to do..
Lets says i have numeric variables ranging from $Sel1Ttl all the way through to $Sel80Ttl,
is there an easy method to add all the values together via a loop.
Instead of typing $Sel1Ttl + $Sel2Ttl + Sel3Ttl...... + $Sel80Ttl.
I.e. can you break the name of the scalar up and insert a number into it $Sel1......80Ttl so i can then use that in my additions.. ?
Lets says i have numeric variables ranging from $Sel1Ttl all the way through to $Sel80Ttl,
is there an easy method to add all the values together via a loop.
Instead of typing $Sel1Ttl + $Sel2Ttl + Sel3Ttl...... + $Sel80Ttl.
I.e. can you break the name of the scalar up and insert a number into it $Sel1......80Ttl so i can then use that in my additions.. ?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Adding scalars but with a twist..
by Corion (Patriarch) on Feb 13, 2005 at 09:44 UTC | |
by snappybo (Initiate) on Feb 13, 2005 at 15:12 UTC | |
by Jenda (Abbot) on Feb 13, 2005 at 20:36 UTC | |
by holli (Abbot) on Feb 13, 2005 at 15:44 UTC | |
by snappybo (Initiate) on Feb 14, 2005 at 04:51 UTC | |
by holli (Abbot) on Feb 14, 2005 at 05:40 UTC | |
Re: Adding scalars but with a twist..
by holli (Abbot) on Feb 13, 2005 at 09:53 UTC | |
Re: Adding scalars but with a twist..
by Joost (Canon) on Feb 13, 2005 at 11:57 UTC | |
Re: Adding scalars but with a twist..
by TilRMan (Friar) on Feb 13, 2005 at 18:38 UTC | |
Re: Adding scalars but with a twist..
by davido (Cardinal) on Feb 14, 2005 at 03:15 UTC | |
Re: Adding scalars but with a twist..
by Dietz (Curate) on Feb 13, 2005 at 09:51 UTC | |
Re: Adding scalars but with a twist..
by Anonymous Monk on Feb 14, 2005 at 10:05 UTC |
Back to
Seekers of Perl Wisdom