I'll refrain from the obligatory "You should use a hash instead..." statement on the assumption that this is simply a learning exercise. :)$cmd1 = 'This'; $cmd2 = 'Is'; $cmd3 = 'a'; $cmd4 = 'test'; my @cmds = map {${"cmd$_"}} (1..4); for (@cmds){ print "$_\n"; }
In reply to Re: Specifiying a Range for Variables?
by joealba
in thread Specifiying a Range for Variables?
by dru145
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |