in reply to array element as foreach iterator
I have to admit - I've never thought about doing this ... but I can see how that would be some really nice-tasting syntactic sugar.... I would normally look at it this way:
#! user/bin/perl use warnings; use strict; my @x = ( [1,1], [2,2], [3,3] ); sub do_something {} # so, I use this method instead foreach my $a1 (@x) { foreach my $a2 (@x) { do_something($a1, $a2); } }
But maybe that's just me thinking "inside the box" again.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: array element as foreach iterator
by kingm61 (Initiate) on Jan 27, 2005 at 17:29 UTC | |
by nobull (Friar) on Jan 27, 2005 at 18:28 UTC |