aquarium has asked for the wisdom of the Perl Monks concerning the following question:
this doesn't work....docos are bare on this....how to construct variable names on the fly?$var1 = 7; $var2 = 3; foreach $number(1..2) { print $var${number} . "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: construct variable name on the fly
by Fletch (Bishop) on Oct 19, 2004 at 00:44 UTC | |
by aquarium (Curate) on Oct 19, 2004 at 01:29 UTC | |
|
Re: construct variable name on the fly
by Juerd (Abbot) on Oct 19, 2004 at 20:44 UTC | |
|
Re: construct variable name on the fly
by nedals (Deacon) on Oct 19, 2004 at 06:49 UTC | |
|
Re: construct variable name on the fly
by TedPride (Priest) on Oct 19, 2004 at 14:04 UTC | |
|
Re: construct variable name on the fly
by aquarium (Curate) on Oct 19, 2004 at 01:11 UTC | |
by pg (Canon) on Oct 19, 2004 at 02:00 UTC | |
| |
|
Re: construct variable name on the fly
by bradcathey (Prior) on Oct 19, 2004 at 00:39 UTC | |
by pg (Canon) on Oct 19, 2004 at 02:05 UTC | |
by Fletch (Bishop) on Oct 19, 2004 at 00:45 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |