Package: perl
Version: 5.8.4-8sarge4
Severity: wishlist
Syntax like this would be nice:
foreach ($i, $j, $k) (@arr) {
...
}
The effect would be something like this:
for ($_tmp = 0; $_tmp < @arr; $_tmp += 3) {
$i = $arr[$_tmp];
$j = $arr[$_tmp+1];
$k = $arr[$_tmp+2];
warn "non-congruant number of items in foreach" if $_tmp+2 >=
@arr;
{
...
}
}
That warning message is horrible, but... I hope that illustrates the
idea.
Naturally, you could also use my:
foreach (my ($i, $j, $k)) (@arr) {
...
}
[I'm guessing the parentheses around the list of variables would make
parsing easier. That's the only reason I've placed them there.]
-- System Information:
Debian Release: 3.1
APT prefers stable
APT policy: (500, 'stable'), (100, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-2-686-smp
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages perl depends on:
ii libc6 2.3.2.ds1-22sarge3 GNU C Library: Shared libraries an
ii libdb4.2 4.2.52-18 Berkeley v4.2 Database Libraries [
ii libgdbm3 1.8.3-2 GNU dbm database routines (runtime
ii perl-base 5.8.4-8sarge4 The Pathologically Eclectic Rubbis
ii perl-modules 5.8.4-8sarge4 Core Perl modules
Versions of packages perl recommends:
ii perl-doc 5.8.4-8sarge4 Perl documentation
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]