> Hi all - should be simple - but I cannot figure it out > > basically i want to name an array with a subscript ie > world0[0] and world1[0] the 0/1 being a variable, i have tried to > produce a simple example.... > > For any help - thanks.. > ---------------------------------------------------------- > @fred = "one,two,three,four"; > > $a=0; > > @array$a=split(/,/, @fred) > > for ($b=0;$b<4;$b++) { > print @array$a[$b]; > }
Just FYI, it is possible to do that, like so: my $fred = 'one,two,three,four'; my $a = 0; @{"array$a"} = split ',', $fred; for(0..3) { print ${"array$a"}[$b] } Cheers, -dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]