Skip Menu |
Report information
Id: 1418
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors:
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: docs
Perl Version: (no value)
Fixed In: (no value)



Download (untitled) / with headers
text/plain 906b
NOTE: I'm not saying this should be implemented in perl5.006, so TomC you can sit down... :-) Two forms: for my(a, b, c) (a1, b1, c1, a2, b2, c2, ...) { } and: for my(a, b, c) (a1, a2, ...) (b1, b2, ...) (c1, c2, ...) { } They are actually unambiguous... :-) As a simplification: for my(a) (a1, a2, ...) { } Is just a simplification of both of the above... :-) mark -- markm@nortelnetworks.com/mark@mielke.cc/markm@ncf.ca __________________________ . . _ ._ . . .__ . . ._. .__ . . . .__ | CUE Development (4Y21) |\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | Nortel Networks | | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them... http://mark.mielke.cc/
Download (untitled) / with headers
text/plain 685b
How does the extension go? for my(Dog $dog, Cat $cat) (@list_of_alternating_dog_cats) { ... } mark (who has only wished for such a syntax once every 3 months or less) -- markm@nortelnetworks.com/mark@mielke.cc/markm@ncf.ca __________________________ . . _ ._ . . .__ . . ._. .__ . . . .__ | CUE Development (4Y21) |\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | Nortel Networks | | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them... http://mark.mielke.cc/
Download (untitled) / with headers
text/plain 252b
I don't like that one as much - the most common use I have for this is foreach my ($key,$value) (%hash) or foreach my ($option,$value) (@_) Show quoted text
> > Tuomas
-- Nick Ing-Simmons <nik@tiuk.ti.com> Via, but not speaking for: Texas Instruments Ltd.
Download (untitled) / with headers
text/plain 550b
On Thu, 16 Sep 1999, Mark Mielke wrote: Show quoted text
> On Thu, Sep 16, 1999 at 10:19:06AM -0700, "Larry Wall" wrote:
> > Michael G Schwern writes: > > : So, any reason why: foreach my Dog $spot (...) {...} shouldn't work? > > Seems reasonable to me. Especially since we might get tremendous > > compiler speedups out of > > for my int $i (1 .. 1_000_000) { }
> > How does the extension go? > > for my(Dog $dog, Cat $cat) (@list_of_alternating_dog_cats) { > ... > }
for my(Dog $dog, Cat $cat) (@list_of_dogs) (@list_of_cats) { } Tuomas
Download (untitled) / with headers
text/plain 586b
I find myself having to do: package Class; use fields qw(foo bar); sub new { bless [] } package main; my Class $this = Class->new; my Class $that = Class->new; foreach ($this, $that) { my Class $obj = $_; # etc... } foreach my Class $obj ($this, $that) { would be much simpler. Alas, this requires a toke/lex patch, which is waaaay outside of my skillset. :( -- Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern /(?:(?:(1)[.-]?)?\(?(\d{3})\)?[.-]?)?(\d{3})[.-]?(\d{4})(x\d+)?/i


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org