From: "Pat Rice" <[EMAIL PROTECTED]> > I would like to know how to do the following > I have a whole bunch of arrays eg var1 var2 var3 var4 var5 var6 var7
In that case you most likely should have an array of arrays. > and I need each of them to be processed, in the one foreach loop, eg > > foreach var(@var1, @var2, @var3, @var4, @var5, @var6){ > > Do somthing here on each var > } > > is this passable, an how would I do it, basically I am looking for guidance > here on how to do this, from a Perl point of view, would hashes be the > answer ? Maybe you want foreach my $arr ( \(@var1, @var2, @var3, @var4, @var5, @var6) ) { print "$arr->[0]\n"; # print the first element in each array push @$arr, 999; # add something to the arrays } The \( @arr1, @arr2, ...) is equivalent to ( [EMAIL PROTECTED], [EMAIL PROTECTED], ...). HTH, Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/