rhxk has asked for the wisdom of the Perl Monks concerning the following question:
say I have
$a1 = 0; $a2 = 1; $a3 = 4; $b1 = 8; $b2 = 2; $b3 = 9; $c1 = 1; $c2 = 4; $c3 = 7;
and I want to print the values of a1,a2,...,b1,b2,...,c1,c2,..., and so on in this manner:
for ($i=1; $i<=3; $i++) { print ${"a$i"}.${"c$i"}.${"c$i"}; }
is there something wrong with this?
I know I know this, but somehow a moth has gotten in my head. :(
thanx...
Code tags added by GrandFather
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: for loop help
by jwkrahn (Abbot) on May 15, 2006 at 20:33 UTC | |
|
Re: for loop help
by moklevat (Priest) on May 15, 2006 at 20:34 UTC | |
by codeacrobat (Chaplain) on May 16, 2006 at 12:45 UTC | |
|
Re: for loop help
by samtregar (Abbot) on May 15, 2006 at 20:34 UTC | |
|
Re: for loop help
by dsheroh (Monsignor) on May 15, 2006 at 20:43 UTC | |
|
Re: for loop help
by rhxk (Beadle) on May 15, 2006 at 22:28 UTC | |
|
Re: for loop help
by swampyankee (Parson) on May 15, 2006 at 20:48 UTC |