- or download this
$cmd1 = 'This';
$cmd2 = 'Is';
...
$cmd4 = 'test';
my @cmds = map{eval '$cmd'.$_} (1..4);
- or download this
my $t='(';
$t.= "\$cmd$_, " for (1..4);
@cmds = eval $t.')';
- or download this
$cmd1 = 'This';
$cmd2 = 'Is';
...
$cmd4 = 'test';
my @cmds = map{ ${"cmd$_"} }(1..4);