develooper Front page | perl.perl5.porters | Postings from March 2000

for my($x,$y) (@array) { ... }

Thread Next
Graham Barr
March 1, 2000 08:03
for my($x,$y) (@array) { ... }
Message ID:
First off I am not suggesting that this be added.

But is there an interest for the following code

  @array = (1,2,3,4);
  foreach my($x,$y) (@array) {
    print "$x $y\n";

which outputs

  1 2
  3 4

I have the beginnings of a patch for this, which supports any number of variables not just 2,
although it can probably be improved a great deal.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About